File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes relative search in lucene Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "relative search in lucene" Watch "relative search in lucene" New topic

relative search in lucene

MaheshEnsarm More

Joined: Mar 20, 2012
Posts: 1

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

Joined: Sep 21, 2011
Posts: 2409
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.)
subject: relative search in lucene
It's not a secret anymore!