Mailing List Archive

Using the UnStored Field() type
Hi-

If the field is tokenized and indexed, can I still search that field?

My code looks like this:

theDocument = new Document();
if ( 0 != textString.length() ) {
textField = Field.UnStored( FIELD_TEXT, textString );
theDocument.add( textField );
}

then I search it like this:

indexReader = IndexReader.open( "C:\\temp\\index_store" );
Term searchTermTiny = new Term( DocumentVisitor.FIELD_TEXT, "Syndeo" );
FuzzyQuery query = new FuzzyQuery( searchTermTiny );
IndexSearcher search = new IndexSearcher( indexReader );
Hits foundDocs = search.search( query );

I never get any results for the documents. Syndeo occures often.
Any ideas?

TIA

Jason

Jason Mawdsley ~ jason@macadamian.com
Software Designer ~ m_ a c a d a m i a n t e c h n o l o g i e s

"Software experts for the world's leading technology companies."
http://www.macadamian.com

Because software development cycles should not end in tragedy.


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Using the UnStored Field() type [ In reply to ]
> If the field is tokenized and indexed, can I still search that field?

Yes.

> My code looks like this:
>
> theDocument = new Document();
> if ( 0 != textString.length() ) {
> textField = Field.UnStored( FIELD_TEXT, textString );
> theDocument.add( textField );
> }
>
> then I search it like this:
>
> indexReader = IndexReader.open( "C:\\temp\\index_store" );
> Term searchTermTiny = new Term( DocumentVisitor.FIELD_TEXT, "Syndeo" );
> FuzzyQuery query = new FuzzyQuery( searchTermTiny );
> IndexSearcher search = new IndexSearcher( indexReader );
> Hits foundDocs = search.search( query );
>
> I never get any results for the documents. Syndeo occures often.
> Any ideas?

You don't show us code to save the document in the index
but I assume you are doing that! Is FIELD_TEXT the
same as DocumentVisitor.FIELD_TEXT?

A short but complete program makes it easier to spot
problems rather than making wild guesses.



--
Ian.
ian@digimem.net

----------------------------------------------------------------------
Searchable personal storage and archiving from http://www.digimem.net/