I would expect it to do this automatically, because "liz" has fewer tokens
than "lizz". However, to ensure that it works the way you want, you can
index the field as a multi-field, using (eg) the standard analyzer on the
main field, and your edge-ngrams on another field.
The use a bool query which matches against both fields - you'll find docs
that match the ngrams, but docs with exact matches will be boosted by the
clause on the main field.
We are encountering the same issue. This sounds like a bug. Should we file
a ticket against ES?
Thanks,
Bob
On Thursday, 23 May 2013 06:03:52 UTC-4, Clinton Gormley wrote:
I would expect it to do this automatically, because "liz" has fewer tokens
than "lizz". However, to ensure that it works the way you want, you can
index the field as a multi-field, using (eg) the standard analyzer on the
main field, and your edge-ngrams on another field.
The use a bool query which matches against both fields - you'll find docs
that match the ngrams, but docs with exact matches will be boosted by the
clause on the main field.
clint
On 21 May 2013 19:39, Chad Kouse <chad....@gmail.com <javascript:>> wrote:
If I search for "liz" I need an exact match of "liz" to score higher than
"lizz"
Can I do this all in one query or do I need to run a separate query to
look for an exact match?
--chad
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
It's 2017, and I'm still have the same problem? Did anyone figure this out without using multi-field? Or is that the only way? I'd really love to know! Thanks in advance!
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.