【发布时间】:2017-05-06 15:52:27
【问题描述】:
我有这个索引:
"analysis" : {
"filter" : {
"meeteor_ngram" : {
"type" : "nGram",
"min_gram" : "2",
"max_gram" : "15"
}
},
"analyzer" : {
"meeteor" : {
"filter" : [
"meeteor_ngram"
],
"tokenizer" : "standard"
}
}
},
还有这份文件:
{
"_index" : "test_global_search",
"_type" : "meeting",
"_id" : "1",
"_version" : 1,
"found" : true,
"_source" : {
"name" : "LightBulb Innovation",
"purpose" : "The others should listen the Innovators and also improve the current process.",
"location" : "Projector should be set up.",
"meeting_notes" : [
{
"meeting_note_text" : "The immovator proposed to change the Bulb to Led."
}
],
"agenda_items" : [
{
"text" : "Discuss The Lightning"
}
]
}
}
尽管我没有进行小写过滤或标记化,但这两个查询都返回了文档:
curl -XGET 'localhost:9200/global_search/meeting/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"match": {
"name": "lightbulb"
}
}
}
'
curl -XGET 'localhost:9200/global_search/meeting/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"match": {
"name": "Lightbulb"
}
}
}
'
这是映射:
→ curl -XGET 'localhost:9200/global_search/_mapping/meeting?pretty'
{
"global_search" : {
"mappings" : {
"meeting" : {
"properties" : {
"agenda_items" : {
"properties" : {
"text" : {
"type" : "text",
"analyzer" : "meeteor"
}
}
},
"location" : {
"type" : "text",
"analyzer" : "meeteor"
},
"meeting_notes" : {
"properties" : {
"meeting_note_text" : {
"type" : "text",
"analyzer" : "meeteor"
}
}
},
"name" : {
"type" : "text",
"analyzer" : "meeteor"
},
"purpose" : {
"type" : "text",
"analyzer" : "meeteor"
}
}
}
}
}
}
【问题讨论】:
-
你的映射在哪里?
-
我添加了@RoiHatam
-
@Boti 上面的文档是哪个索引的?是
test_global_search还是global_search?两个索引是否具有相同的映射?
标签: elasticsearch