同様の解決策を探していましたが、プレフィックスのみに一致します。私は@imtovの答えを見つけて、ほぼそこにたどり着きましたが、1つの変更点として、アナライザーを切り替えました。
"mappings": {
"doc": {
"properties": {
"dots": {
"type": "string",
"analyzer": "keyword",
"search_analyzer": "prefix-test-analyzer"
}
}
}
}
それ以外の
"mappings": {
"doc": {
"properties": {
"dots": {
"type": "string",
"index_analyzer": "prefix-test-analyzer",
"search_analyzer": "keyword"
}
}
}
}
このように追加します:
'{"dots": "first.second"}'
'{"dots": "first.third"}'
first
、second
、トークンを保存せずに、これらの完全なトークンのみを追加しthird
ます。
まだどちらかを探している
first.second.anyotherstring
first.second
最初のエントリのみを正しく返します。
'{"dots": "first.second"}'
あなたが求めたものとは正確には異なりますが、何らかの形で関連しているので、誰かを助けることができると思いました.