Hi Sebastin,
Sebastin wrote:
> i index my document using SimpleAnalyzer() when i search the Indexed
> field in the searcher class it doesnt give me the results.help me to sort
> out this issue.
>
> My Code:
>
> test="9840836598"
> test1="bch01"
>
> testRecords=(test+" "+test1);
>
> document.add("testRecords",testRecords,Field.Store.NO,Field.Index.Tokenized)
>
> indexwriter.addDcument(document,new SimpleAnalyzer());
SimpleAnalyzer "filters LetterTokenizer with LowerCaseFilter"[1].
LetterTokenizer "divides text at non-letters .... [T]okens [are] maximal
strings of adjacent letters"[2].
This means that your index has "bch" as the single token for the
document you added.
Luke[3] is an excellent tool for browsing Lucene indexes (among other
capabilities) - you can use it to help you figure out exactly the issues
you're facing - i.e., how do analyzed documents and queries look.
Steve
[1]
http://lucene.apache.org/java/2_1_0/api/org/apache/lucene/analysis/SimpleAnalyzer.html
[2]
http://lucene.apache.org/java/2_1_0/api/org/apache/lucene/analysis/LetterTokenizer.html
[3] http://getopt.org/luke/
--
Steve Rowe
Center for Natural Language Processing
http://www.cnlp.org/tech/lucene.asp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]