You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mark Ferguson <ma...@gmail.com> on 2009/03/02 19:49:14 UTC

Filter query for number of matches

Hi,

I am wondering if there is a way to set a filter on the frequency of a
keyword match in a document. For example, if I search for the word "cheerio"
I would like that word to appear at least x times in a field in order for
the document to be returned. I know that Lucene internals already give
higher scoring to more matches, but I would like to set a minimum barrier of
entry.

Thank you,

Mark

Re: Filter query for number of matches

Posted by Erick Erickson <er...@gmail.com>.
Do you have special restrictions on your documents that make
this reasonable? In the absurd case of having one word in the
field and that word matches (i.e. 100% of the words in the field
*are* the search term), would you really *not* want that document
returned?

I guess I'm asking what you're really trying to accomplish here,
or why the current way things work is inadequate.

Best
Erick

On Mon, Mar 2, 2009 at 1:49 PM, Mark Ferguson <ma...@gmail.com>wrote:

> Hi,
>
> I am wondering if there is a way to set a filter on the frequency of a
> keyword match in a document. For example, if I search for the word
> "cheerio"
> I would like that word to appear at least x times in a field in order for
> the document to be returned. I know that Lucene internals already give
> higher scoring to more matches, but I would like to set a minimum barrier
> of
> entry.
>
> Thank you,
>
> Mark
>