Hi Amitesh

Thanks for the more concrete examples.

Unfortunately I do not know how to solve this better with Lucene itself in a more general context, but did you ever consider using BERT in combination with Lucene/Solr

https://blog.google/products/search/search-language-understanding-bert/
https://dmitry-kan.medium.com/neural-search-with-bert-and-solr-ea5ead060b28 <https://dmitry-kan.medium.com/neural-search-with-bert-and-solr-ea5ead060b28> https://medium.com/swlh/fun-with-apache-lucene-and-bert-embeddings-c2c496baa559 <https://medium.com/swlh/fun-with-apache-lucene-and-bert-embeddings-c2c496baa559>

HTH

Michael

Am 28.04.21 um 23:29 schrieb amitesh116:
Hi Gus, Thank you your reply!

In my search system; users are complaining that they get results with
negation terms when don't expect. As explained in my original post. User
don't want to get documents having a term like "Non Vitamin K" when they
search for "Vitamin K".

But because each terms are analyzed and tokenized, currently this system
does return both the docs. There are few more negation prefixes that we are
trying to handle.

Further, I did find a way to solve this problem.

I assigned tokenStream to each field and avoid use of analyzer. This way I
am able to control the full string assigned to a field  for tokenization.
Also, I wish to clarify that though we wish to handle the negation searches
as above, end user are not expected to notice the difference in text ( i.e.
a Non Vitamin K will be stored as Non Vitamin K only but its tokenized form
would be tweaked so that it does not results in a search of "Vitamin K")

I will take cue from your advise and avoid such desperation in future.

Regards
Amitesh



--
Sent from: https://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to