lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <psm...@aconex.com>
Subject Re: "Starts with" query?
Date Thu, 05 Jan 2006 23:43:53 GMT
> 2) index a magic token at the start of the title and include that in a
> phrase query:
>    "_START_ the quick"

Ok, I've gone and chose "0start0" as my start token, because our  
analyzer is stripping _.

Now, second dumb question of the day, give the search for starts with  
"The qui*", that has to be turned into a prefix query, like so?

new PrefixQuery(new Term("title", "0start0 " +  "The qui"))

Is that the right approach?  To always prefix the search term string  
with the magic start text?

I ask this because I'm getting weird results in my search now, as all  
documents are being matched.  When the query is finally run, it looks  
like this:

+(orgid:7 publicflag:1 sharedorgid:7) +isregistered:1 +title:'0start0  
f'* +cversion:1

(you can ignore all but the title field in this case, the rest is  
correct for our app).

Paul

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