Storing efficient queries in percolator


I have a number of relatively complicated queries that I want to store in percolator, but they are strictly yes-no. Therefore, what I'd really like to do is use a filter, rather than a query. I can wrap filter in a filtered query and add that (sans query) but that seems clunky. Is there a way to simple add a filter to percolator? Or am I thinking about it wrong and I should always think of filters in context of a query?

(Mark Harwood) #2

I haven't benchmarked it but I suspect query vs filter performance matters less for percolation scenarios.

In normal search, filters can wind up as large cached bitsets with a 1 or 0 yes/no for millions of documents in a mostly static index. Cache hit ratios are very high so very efficient.
In a percolation scenario the index is a transient in-memory one with only one document (the document currently being percolated). The filter bitset produced would only be of length 1 and of zero re-use because the next run of the query will be on an entirely different index with different contents.

(system) #3