lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cam Bazz" <>
Subject PrefixQuery question
Date Tue, 08 Jan 2008 11:13:01 GMT

I am having a problem qith PrefixQuery:

I have a field name item title which is indexed as:

doc.add(new Field("item_title", item_title.trim().toLowerCase(),
Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.YES));

and I am forming my query like:

PrefixQuery pq = new PrefixQuery((new Term("item_title", queryText)));

Lets say I have some documents such as

mouse cat apple
mouse cat house
cat house mouse

and when I search for prefix mou, it will return all of 3 documents. what I
like to do is for it to return "mouse cat apple" and "mouse cat house" and
not "cat house mouse"

it will only do this if the field is untokenized I believe.

is there any way to get the desired behavior?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message