検索クエリでアナライザーを制御したいと考えています。
現時点では、私のコードは次のようになります。
client.execute(search in indexName / documentType query {
bool {
must(
termQuery("email", email),
termQuery("name", name)
)
}
}
ここでアナライザーを制御するにはどうすればよいですか?
検索クエリでアナライザーを制御したいと考えています。
現時点では、私のコードは次のようになります。
client.execute(search in indexName / documentType query {
bool {
must(
termQuery("email", email),
termQuery("name", name)
)
}
}
ここでアナライザーを制御するにはどうすればよいですか?
term
クエリは検索用語を分析しないことに注意してください。そのため、探しているのはおそらくmatch
クエリであり、次のようになります。
client.execute(search in indexName / documentType query {
bool {
must(
termQuery("email", email),
matchQuery("name", name) <--- change this to match query
.analyzer(StandardAnalyzer) <--- add this line
)
}
}
テスト ケースも優れた情報源です。このSearchDslTest.scala
ファイルには、クエリの可能なすべてのプロパティを設定する方法が記載されていmatch
ます。