I feel like I must be missing something, but how do I filter on an exact
string match? In other words, I want either the entire field to match or not
at all.
The "text" filter of type "phrase" will match even when the query string is
only a subset of the field, and the "term" filter won't work when the field
is an identifier with hyphens in it.
Relatedly, is there a way to do an exact match on number and boolean fields?
You always do exact matches on number and boolean fields (using either term query or term filter). For text, you can make the field as index set to not_analyzed in order for it not to be analyzed and treated as a single token.
On Tuesday, June 14, 2011 at 7:38 PM, Eric Mill wrote:
I feel like I must be missing something, but how do I filter on an exact string match? In other words, I want either the entire field to match or not at all.
The "text" filter of type "phrase" will match even when the query string is only a subset of the field, and the "term" filter won't work when the field is an identifier with hyphens in it.
Relatedly, is there a way to do an exact match on number and boolean fields?
You always do exact matches on number and boolean fields (using either
term query or term filter). For text, you can make the field as index set
to not_analyzed in order for it not to be analyzed and treated as a single
token.
On Tuesday, June 14, 2011 at 7:38 PM, Eric Mill wrote:
I feel like I must be missing something, but how do I filter on an exact
string match? In other words, I want either the entire field to match or not
at all.
The "text" filter of type "phrase" will match even when the query string is
only a subset of the field, and the "term" filter won't work when the field
is an identifier with hyphens in it.
Relatedly, is there a way to do an exact match on number and boolean
fields?
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.