lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilton, Reece" <Reece.Wil...@dig.com>
Subject RE: Exact Match
Date Wed, 22 Oct 2003 16:48:36 GMT
If I use an untokenized field, would "fox" match this as well?  I need
to support both exact match searches and searches where one word exists
in the field.

-----Original Message-----
From: Doug Cutting [mailto:cutting@lucene.com] 
Sent: Wednesday, October 22, 2003 9:44 AM
To: Lucene Users List
Subject: Re: Exact Match

Wilton, Reece wrote:
> Does Lucene support exact matching on a tokenized field?
> 
> So for example... if I add these three phrases to the index:
> - "The quick brown fox"
> - "The quick brown fox jumped"
> - "brown fox"
> 
> I want to be able to do an exact field match so when I search for
"brown
> fox" I only get the last one returned.  I can do this in my own code
by
> storing the data and then comparing it to the search phrase.  Is that
> the best way of doing this?

Why not just use an untokenized field?  Then just use a TermQuery, 
searching for the term "brown fox".

Doug


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



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


Mime
View raw message