How to use filters from Java API in elasticsearch 0.7?


(Nicolas-3) #1

Hi,

I was wondering how I could use the filter capabilities in the 0.7. In
the 0.6 Filters were implementing JsonQueryBuilder but it is no more
the case. So I cannot specify any filters in the SearchRequest. Do you
intend to add special filter() method on this object?

Is that because it is work in progress or shall I open an issue on
GitHub?

Thanks for this wonderful search engine btw,

Nicolas


(Shay Banon) #2

There was a bug and it was fixed in this area. You can't use filters as
queries, what you need to do is use a query that can accept a filter. For
example, the FilteredJsonQueryBuilder ("filtered") can accept a query and a
filter, or the ConstantScoreQueryJsonQueryBuilder ("constantScoreQuery") can
wrap a filter as a query.

cheers,
shay.banon

On Fri, Apr 23, 2010 at 2:18 PM, Nicolas leroux.nicolas@gmail.com wrote:

Hi,

I was wondering how I could use the filter capabilities in the 0.7. In
the 0.6 Filters were implementing JsonQueryBuilder but it is no more
the case. So I cannot specify any filters in the SearchRequest. Do you
intend to add special filter() method on this object?

Is that because it is work in progress or shall I open an issue on
GitHub?

Thanks for this wonderful search engine btw,

Nicolas


(system) #3