Reputation: 11
UPDATED ORIGINAL QUESTION
I created a program that pulls in content from a database and then indexes it. During this process, I build a string variable called searchField which consists of various different information. Once this string is built, I make the following call.
doc.add(new Field("search", this.stripHTMLTags(searchField), Field.Store.NO, Field.Index.ANALYZED));
I know that the string is not empty, because I put in a print statement to show the contents and the right data is making it to the doc.add().
When I search key words what do in fact show up in the searchField, I get no hits.
I'm not sure what other details to provide, and I'm sure there is more needed, please help me help you understand better and hopefully this can get solved!
Thanks in advance!
Upvotes: 1
Views: 770
Reputation: 80166
I'd suggest you index it to a file directory and then use Luke to look into what being indexed. Luke is the best tool to debug the Lucene related issues.
Now my hunch is that you are using different analyzers while indexing and searching. Make sure your index and search operations use the same analyzer.
Upvotes: 1
Reputation: 7412
Try
doc.add(new Field("search", this.stripHTMLTags(searchField), Field.Store.YES, Field.Index.ANALYZED));
Upvotes: 1