Multi-factor synonyms with Lucene.NET.

I have an application using lucene.Net and am having problems using the Lucene synonyms function with a few words in a search phrase / term

For example, if I want to find the word "superman" and establish a synonym: "spider-man" I expect (and do) the results associated with the "spider" , as well as "superman"

Now I want to find Justice League and establish a synonym for this term as Avengers .

and also say Superman and the synonym of Justice League .

You will get where I am going with this. I want it to be possible in the end to establish strong words with a few sentences . I know that synonyms are really 1 word per 1 word, but is there any user approach with Lucene.NET or Lucene itself, in general, people use this problem. I heard that lucene added this function, but I have not seen anything so far, looking around, which I find useful.

Thanks Ed

+4
source share
1 answer

Take a look at solr.SynonymFilterFactory

, , SynonymFilter , (: " , , " ). , , . , , :

  • Lucene QueryParser , - , , " ", "" "" , , .
  • (.. " " ) QueryParser , SynonymFilter , , QueryParser Analyzer, MultiPhraseQuery, . , , , : , "" , . MultiPhraseQuery "( | | ) (biscuit | biscit)", " ",
+1

Source: https://habr.com/ru/post/1536112/


All Articles