lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Retrieving exact matches
Date Tue, 06 Feb 2007 14:10:28 GMT
One way to do this is to store the fields UN_TOKENIZED (and be careful to
index and search with compatible Analyzers!!) Also, watch your
capitalization. But this is a bit tricky, since if you index UN_TOKENIZED,
you would never get a match for your second document above unless you
searched on "picasso pablo". In particular, what if you were searching on
"picasso, pablo"? Since the comma is not stripped (the search terms being
UN_TOKENIZED), it wouldn't match your second document above. You can get
around this with some pre-processing, but be aware that when you are asking
for exact matches using UN_TOKENIZED fields, you really have to be careful
about how you handle these kinds of situations. This is true when indexing
AND when searching.

Also, this is suitable only for pretty strictly defined fields. You might
find yourself indexing the same data several different ways if you sometimes
want to search on exact phrases and sometimes on partial...

But I don't understand your example and I'm assuming that you'd want one
match in your example, but not two.


Best
Erick

On 2/6/07, Mile Rosu <mile.rosu@level7.ro> wrote:
>
>
> Hello,
>
>
> I have been looking in the documentation but haven't found a solution to
> this:
>
> is there a way to retrieve only the record "picasso" when the query is
> picasso and not the records: "picasso","picasso pablo"  ie a 100% match
> of the query ?
>
>
> Thank you,
> Mile Rosu
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message