lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <psm...@aconex.com>
Subject "Starts with" query?
Date Thu, 05 Jan 2006 22:09:14 GMT
I'm throwing myself at the mercy of the lucene community, I'm a bit  
brain dead today after looking after a screaming 3 month old baby for  
4 hours last night...

We have a 'title' field indexed as Field.Text(...), which works  
nicely, and has lots of good searching.

However, this application is being ported from a DB based search,  
which had originally a "starts with" type search, and we need to  
support that.

So, given "The quick brown fox jumped of the caffeine addicted  
software developer", if the user types "The quick*" we need to find  
only those that have a title that starts with, and NOT match  
documents that have "The quick" as a sequence of terms later in the  
title (ie don't match "blah blah the quick blah blah").

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

How do I do that with Lucene?  I'm sure this a is a dumb question,  
and I know that Lucene's searching is way more useful than that, but  
you know these pesky compatibility requirements.....It's screwing  
with my unit tests because the new index search results are getting  
more results that the old db method.

cheers,

Paul Smith

---------------------------------------------------------------------
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