Hello,

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?

best,
-C.B.

Reply via email to