Thanks Simon & Grant.
Yes, the indexWriter was close()'d before searching. As Grant pointed out,
the issue really was with the Analyzer. Everything worked when I replaced
the KeywordAnalyzer with a SimpleAnalyzer.
Luke seems to be god-sent (no pun) -- With a KeywordAnalyzer, the entire
"content"
Another question,
do you commit your indexwriter before you open your searcher. You
could also check how many docs in the index using IndexReader#numDocs
and pass the index reader to the indexsearchers constructor.
Just a guess too...
simon
On Sun, Jun 7, 2009 at 6:40 PM, Grant Ingersoll wrote:
If I had to guess, I'd say you have some type of Analysis mismatch
between what you are indexing and what you are searching. Do you
really want to use the KeywordAnalyzer?
You might use Luke (http://www.getopt.org/luke) to have a look at your
index and see if that sheds some light.
Also
Hi,
Mentioned below are snippets from my indexing and searching code. For some
reason, I get zero hits all the time even for terms present in the document
collection. Can somebody point out where I'm going wrong? I'm using
lucene-core-2.4.0.jar.
Thanks!
Delip
---
Indexer.jav