Did you try SpanFirstQuery? I had the same need in my application, for implementing type-ahead functionality over the titles and I found that storing them as un_tokenized gives the best performance (of course, I don't run any query, but iterate over the terms in my solution). Span queries are expensive, but you can try it.
On Jan 8, 2008 1:13 PM, Cam Bazz <[EMAIL PROTECTED]> wrote: > 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. > -- Regards, Shai Erera