How to use filters from Java API in elasticsearch 0.7?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use filters from Java API in elasticsearch 0.7?

Nicolas-3
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
Reply | Threaded
Open this post in threaded view
|

Re: How to use filters from Java API in elasticsearch 0.7?

kimchy
Administrator
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 <[hidden email]> 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