is there a way to have prefix filter get analyzed? i want to somehow get
query: "hel wor" to match {name: "hello world"}
currently, i construct an {and: [{prefix: {name: "hel"}}, {prefix: {name: "wor"}}]}
but this means i have to tokenize the query myself. i'd love to use the same analyzer as i used for indexing.
i considered using the analyze API call to first get the tokens from the query, and then use them to construct the prefix clauses, but it would be nice to avoid the second roundtrip
is there a way to have prefix filter get analyzed? i want to somehow get
query: "hel wor" to match {name: "hello world"}
currently, i construct an {and: [{prefix: {name: "hel"}}, {prefix: {name:
"wor"}}]}
but this means i have to tokenize the query myself. i'd love to use the same
analyzer as i used for indexing.
i considered using the analyze API call to first get the tokens from the
query, and then use them to construct the prefix clauses, but it would be
nice to avoid the second roundtrip
Best is just to avoid the prefix filter
Analyze your text with edge-ngrams or ngrams, and you can achieve the
same thing, but with more efficient queries.
Search this list for questions about ngrams - there are lots of threads
about how to use them
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.