lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Enforcing total matches
Date Mon, 29 May 2006 22:02:53 GMT
: I'd like to know if there's a way to force a query to return only exact
: hits, not partials/subsets. For instance:
: A query "foo bar" will match on a field with "foo bar zoo". This I would
: like to avoid as I'm need of removing duplicates on certain fields. Two
: options considered this far, neither are very pretty:

the example you give is an "exact match" on a sequence of terms in that
fields -- it sounds like what you want is to say that for certain fields,
you want the entire field to be treated as one term.

In Java Lucene this is possible using the KeywordAnalyzer both when you
index the field, and when you use the QueryParser -- i assume
it's present in other versions of Lucene as well.

If you also need to support "tokenized" term matching on the same data,
then you'll need two seperate fields: one using KeywordAnalyzer, and one
using whatever other analyzer you want.


-Hoss


Mime
View raw message