我有這樣的指標:爲什麼彈性檢索查找不區分大小寫
"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
我加了@RoiHatam – Boti
@Boti哪個索引有上面的文件?它是'test_global_search'還是'global_search'?兩個索引有相同的映射嗎? – avr