Hi
i have a a field that contains an ID and then description.
looks like this:
"37463448454 this is the description".
i'm using ngram based analyser on this field (while indexing).
i want the user to be able to search this filed using the id (or parts of it) or words from the description or both of them - that part works.
but when i look only by the specific id , the first result is not always the result with the specific id in it.
i'm using query_string and fuzziness 3 , ngram min 3 max 10
is there a way to boost the score for the doc that contains the specific id so when i search with by the id on that field it would show me the doc that contains the exact id i'm looking for?
how about using a multifield, where the second field is just using a standard analyzer. Then you could use a bool query with a should clause and a term query for the specific id, which would get boosted higher.
Hi
Thanks for your reply
but i have no way of knowing what the user might search
he could search by the ID or by the description or by parts of them both
you could still put that whole query in the should part of the bool query with the standard analyzed field, it will still match for the whole term instead of the ngram analyzed one.
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.