I am a newbie in lucene space. and trying to understand lucene search
result caching; facing with a wierd issue.
After creating the IndexReader from a file system directory, I
rename/remove the index directory; but still I am able to search the
index and able to get the documents from Hits. This is making me beleive
that there is some level of index loading in IndexReader itself. Does it
load the full index or what all things it loads?
The code I am using is:
reader = IndexReader.open("/data/index");
System.out.println("Sleeping...");
Thread.sleep(10000);
//during the sleep time I just delete /data/index dir but still rest of
the code works
System.out.println("Sleeping after");
indexSearcher = new IndexSearcher(reader);
query = MultiFieldQueryParser.parse("yahoo", fields, new
PorterStemAnalyzer());
filter = new QueryFilter(query);
Hits hits = indexSearcher.search(query, filter);
for(int i=0;i<hits.length();i++){
System.out.println(i +": "+ hits.doc(i));
}
-sharad
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]