How Lucene Perform its search
2 posts in topic
Flat View  Flat View

Posted By:   blazzing_wolf
Posted On:   Thursday, June 26, 2008 03:43 AM


I am fairly new to Lucene and is currently going over its source code. I had read through the code for a few times, mapping it and all but I seems to be facing a problem. I could go all the way to the calculation of score for each result obtain, but strangely I did not managed to locate the part where Lucene open the index and check for the matching term.

What I mean is that, I want to check on how Lucene actually open the index and perform the search. I went through all the methods in IndexReader, IndexSearcher and some other related class but still fail to locate the method responsible.

Could anyone help me with this? Thanks

Re: How Lucene Perform its search

Posted By:   Craig_Bowers  
Posted On:   Tuesday, August 12, 2008 11:40 AM

Within IndexSearcher there is a .search() method. You call IndexSearch.search(Query), where Query is Lucene Query object. Most likely the Query object will be returned from a QueryParser call.

Re: How Lucene Perform its search

Posted By:   Anonymous  
Posted On:   Tuesday, July 1, 2008 12:38 PM

What problem are you facing?

Its been a few years since I have worked in Lucene.

Based on my experience, bear in mind the following:

When you delete a document from the index, it is never deleted. Its marked for deletion. You need to optimize the index once in a while, to remove unwanted stuff like these, else the search becomes slow, and the chance of index getting corrup is very high.

Also, make sure, you take a backup of index on a periodic basis, so that you can update a backed-up index from the date it got corrupted.

Also, org.apache.lucene.index.CheckIndex.check() is a nice method.

-Phir Bhi Dil He Hindustani-

About | Sitemap | Contact