Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

relative search in lucene

 
MaheshEnsarm More
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I am having only "Europe" being indexed along with some related data,but when someone searches using the word "Germany" although there is nothing specifically indexed for Germany but logically I can provide results under Europe than providing nothing at all,is there any way to do this? Does lunene have any supporting libraries which can do this?


Thanks in advance,
 
Tim Moores
Bartender
Posts: 2687
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see two possibilities: either build something like the SynonymAnalyzer described in chapter 4.5 of Lucene in Action 2nd ed., or check out the org.apache.lucene.analysis.synonym.WordnetSynonymParser class that comes with Lucene. (If you were going to object that you don't have the book, go buy it now - anybody doing serious work with Lucene needs it. Seriously.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic