我是弹性搜索的新手,我正在尝试使用下面的映射创建索引,我在网上找到了这些映射,并使用kibana作为我的客户机,它抛出错误。
PUT /local_test
{
"settings": {
"index.mapping.total_fields.limit": 1000,
"index.mapping.depth.limit": 20,
"index.mapping.nested_fields.limit": 50,
"number_of_shards": 5,
"number_of_replicas": 1,
"analysis": {
"analyzer": {
"edge_ngram_analyzer": {
"type": "custom",
"tokenizer": "edge_ngram_tokenizer",
"filter": [
"lowercase",
"en_stopwords"
]
},
"standard_custom": {
"type": "custom",
"char_filter": [
"punctuation_remap"
],
"tokenizer": "standard",
"filter": [
"lowercase",
"en_stopwords"
]
},
"lowercase_keyword": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
]
}
},
"tokenizer": {
"edge_ngram_tokenizer": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 50,
"token_chars": [
"letter",
"digit"
]
}
},
"filter": {
"en_stopwords": {
"type": "stop",
"stopwords": "_english_"
}
},
"char_filter": {
"punctuation_remap": {
"type": "mapping",
"mappings": [
". => -",
": => -",
"' => -"
]
}
}
}
},
"mappings": {
"local_test": {
"_all": {
"enabled": false
},
"properties": {
"id": {
"type": "keyword"
},
"user_id": {
"type": "keyword"
},
"created_at": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"docvalue": {
"type": "object",
"dynamic": false,
"enabled": true,
"properties": {
"key": {
"type": "text",
"analyzer": "lowercase_keyword"
},
"value": {
"type": "text",
"analyzer": "lowercase_keyword"
}
}
},
"recurring": {
"type": "boolean"
},
"amount": {
"type": "long"
}
}
}
}
}
“类型”:“映射程序解析异常”,“原因”:“根映射定义有不受支持的参数:[local_test:{u all={enabled=false},properties={amount={type=long},user_id={type=keyword},recurtive={type=boolean},created_at={format=yyyyy-MM-dd HH:MM:ss | | | epoch_-millis,type=date,id={type=keyword关键字},docvalue={dynamic=false,type=object={analyzer=lowercase_关键字,type=text},key={analyzer=lowercase_关键字,type=text}]
以下是您的请求中的两个问题,我假设您使用的是最新的主要版本ie 7。十、
_all
,这是在最新版本中删除的。 local_test
,因为类型也在最新版本中被删除。所以使用下面的请求它工作正常:
Put/local_测试
{
"settings": {
"index.mapping.total_fields.limit": 1000,
"index.mapping.depth.limit": 20,
"index.mapping.nested_fields.limit": 50,
"number_of_shards": 5,
"number_of_replicas": 1,
"analysis": {
"analyzer": {
"edge_ngram_analyzer": {
"type": "custom",
"tokenizer": "edge_ngram_tokenizer",
"filter": [
"lowercase",
"en_stopwords"
]
},
"standard_custom": {
"type": "custom",
"char_filter": [
"punctuation_remap"
],
"tokenizer": "standard",
"filter": [
"lowercase",
"en_stopwords"
]
},
"lowercase_keyword": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
]
}
},
"tokenizer": {
"edge_ngram_tokenizer": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 50,
"token_chars": [
"letter",
"digit"
]
}
},
"filter": {
"en_stopwords": {
"type": "stop",
"stopwords": "_english_"
}
},
"char_filter": {
"punctuation_remap": {
"type": "mapping",
"mappings": [
". => -",
": => -",
"' => -"
]
}
}
}
},
"mappings": {
"properties": {
"id": {
"type": "keyword"
},
"user_id": {
"type": "keyword"
},
"created_at": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"docvalue": {
"type": "object",
"dynamic": false,
"enabled": true,
"properties": {
"key": {
"type": "text",
"analyzer": "lowercase_keyword"
},
"value": {
"type": "text",
"analyzer": "lowercase_keyword"
}
}
},
"recurring": {
"type": "boolean"
},
"amount": {
"type": "long"
}
}
}
}
输出
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "local_test"
}
我有大量相同类型的实体,每个实体都有大量属性,并且我只有以下两种选择来存储它们: 将每个项存储在索引中并执行多索引搜索 将所有enties存储在单个索引中,并且只搜索1个索引。 一般而言,我想要一个时间复杂度之间的比较搜索“N”实体与“M”特征在上述每一种情况!
我想把我的项目连接到弹性搜索。我得到以下错误: com.example.demo.elasticsearch.controller中的字段存储库。控制器需要“com.example.demo.elasticsearch.repository”类型的bean。找不到CustomerRepository“。 注入点有以下注释:- 行动: 所以我构建了一些类,如下所示: Controller.java
我刚加入弹性搜索公司。而不知道如何在JSON请求中对索引和an类型发出正确的请求?(所以我不想像localhost:9200/myindex/mytype/_search那样在URL中使用索引和类型,而是向localhost:9200/_search发出JSON请求) 我试过这样的东西。但我得到的结果是'AAA'索引而不是'BBB'索引。如何只从bbb索引得到结果或者根本没有结果?
当我跑的时候 我得到以下错误: 我试着改变我的ElasticSearch的版本。我的当前版本是: $curl-xget'localhost:9200'{“name”:“mokbeeq”,“cluster_name”:“elasticsearch”,“cluster_uuid”:“pf_z62bbtl-jq31hsuahqa”,“version”:{“number”:“5.6.8”,“build_h
我已经将弹性搜索1.7.1与spring应用程序集成在一起。我有一个cron作业,它在每次运行时更新弹性搜索的索引。我遵循了github上的各种示例代码来使其工作。首先,我为索引目的自动连接了ElasticSearchOperations: 然后以以下方式执行内部循环索引 当我第一次运行它时,它就像预期的那样工作。我已经在config文件夹中的elasticsearch.yml中将cluster重
ElasticSearch索引会随机变空,但大多数情况下,它发生在部署用Rails构建的应用程序之后。 以下是有关ElastiSearch的一些信息: curl-xget“http://localhost:9200/_nodes?pretty” curl-xget“http://localhost:9200/_cluster/health?pretty” curl“localhost:9200/_