lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: "Starts with" query?
Date Thu, 05 Jan 2006 22:33:39 GMT


: Think SQL of " ....where title like 'The quick%'  ".

I solved this problem by having a variation of my field that was not
tokenized, and did PrefixQueries on that field (so in your case, leave
your title field alone for generic matches, and have a titleUntokenized
field for PrefixMatches.

Another approach i have not tried that should work as long as your "starts
with" input is allways whole Terms (ie: "The quick %" and not "The qu%")
is to use a SpanFirstQuery wrapped arround a a SpanNearQuery containing
successive SpanTermQueries with no slop.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message