In my project we use Lucene 2.4.1 for fulltext search. This is a J2EE project, IndexSearcher is created once. In the background, the index is refreshed every couple of minutes (when the content changes). Users can search the index through a search mechanism on the page.
The problem is, the results returned by Lucene seem to be cached somehow.
This is scenario I noticed:
- I start the application and search for 'keyword' - 6 results are returned,
- Index is refreshed, using Luke I see, that there are 8 results now to query 'keyword',
- I search again using the application, again 6 results are returned.
I analyzed our configuration and haven't found any caching anywhere. I have debugged the search, and there is no caching in out code, searcher.search
returnes 6 results.
Does Lucene cache results internally somehow? What properties etc. should I check?