Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
Saloon Keeper
Posts: 3326
61
  • 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.)
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!