下記のようなjsonを登録している場合
json
1{ "index" : { "_index": "index", "_type" : "type", "_id" : "1" }} 2{"name":"aaa", "name_yomi":"bbb", "address":"ccc", "text": "ddd"}
name
name_yomi
address
text
4つのすべてのfieldから文字列「a」の検索がしたい場合は、
json
1{ 2 "query": { 3 "bool" : { 4 "should" : [ 5 { "term" : { "name" : "a" } }, 6 { "term" : { "name_yomi" : "a" } }, 7 { "term" : { "address" : "a" } }, 8 { "term" : { "text" : "a" } } 9 ] 10 } 11 } 12}
という形でQueryを書くしかないのでしょうか?
json
1{ 2 "query": { "match_all": "a" } 3}
のような形でかければ理想ですがないでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。