0
我有一個映射的實體是這樣的:elasticsearch和not_analyzed - 仍然無法找到的東西
{ "Organisation":{
"properties":{
"_abstract_":{
"type":"string",
"store":"yes"
},
"_author_":{
"type":"string",
"store":"yes"
},
"_editdate_":{
"type":"date",
"index":"analyzed",
"store":"yes",
"format":"dateOptionalTime"
},
"_id_":{
"type":"string",
"index":"not_analyzed",
"store":"yes",
"omit_norms":true,
"index_options":"docs"
},
"_title_":{
"type":"string",
"store":"yes"
},
"country":{
"type":"string",
"store":"yes"
},
"countrycode":{
"type":"string",
"index":"not_analyzed",
"omit_norms":true,
"index_options":"docs"
},
"creationdateutc":{
"type":"date",
"index":"analyzed",
"store":"yes",
"format":"dateOptionalTime"
}, ...
COUNTRYCODE可以有類似的值CNTRY/US。我無法查詢 - 它仍然希望將值分成兩個令牌,即使它沒有被分析。例如:
{ "query":{
"bool":{
"must":[
{
"term":{
"countrycode":"cntry/us"
}
}
],
"must_not":[
],
"should":[
]
}}, "from":0, "size":50}
我不明白。我誤解了一些簡單的東西嗎?
你能發表一個完整的repro這個問題嗎? – imotov 2013-02-14 02:15:31
有很多代碼,所以沒有,不是真的。我希望有人遇到同樣的問題並解決它。我認爲這與在索引和搜索時使用的分析器有關。我一直在玩這些,但現在它似乎返回錯誤的結果,而不是沒有結果。嘆息......我需要啤酒...... – Jonesie 2013-02-14 02:56:21
有時候,試圖創建一個小的repro有助於解決這個問題。我可以想到發生這個問題的幾個原因。不幸的是,在你的問題中,我沒有看到足夠的信息來以任何確定性來回答它。我只能猜測可能是錯的。 – imotov 2013-02-14 03:10:17