lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Rowe <sar...@syr.edu>
Subject Re: Performing exact search with Lucene
Date Fri, 02 Apr 2004 16:57:16 GMT
Phil,

If you *really* want exact matching against documents, you could put the
document content into a keyword field (that is, one field per doc, with
no tokenization), then search with your query as a single term, rather
than tokenized into separate terms.  This way, you're guaranteed a match
only if the match is complete and exact.

Of course, if you don't *really* mean exact matching (e.g., if you want
to allow multiple spaces between words, or for newlines to substitute
for spaces, etc.), then you'll have to find a different solution.

Steve Rowe

Phil brunet wrote:

> Thanks for your quick answer. I'm going to try the PhraseQuery as you 
> propose.
> 
> But considering theses three examples :
> 
> document 1 =    "this is an example"
> document 2 =    "this is an example of document"
> document 3 =    "this is an other example"
> 
> i guess that a PhraseQuery, based on :
> 
>    +"this is an example"
> 
> and with setSlop(0) will match document1 AND also document2 ?
> 
> Does the PhraseQuery act as the SQL operator  LIKE  
> "%something_to_search%" or like the '=' SQL operator ?
> 
> I'm going to investigate.
> 
> Thanks again.
> 
> Philippe
> 
> _________________________________________________________________
> MSN Messenger http://g.msn.fr/FR1001/866  : dialoguez en son et en 
> images avec vos amis
> 
> 
> ---------------------------------------------------------------------
> 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