Re: GeoDistanceQuery?


(Clinton Gormley) #1

Hi Ben

I am an ES beginner possibly migrating from Solr and I am trying to
apply a geo distance query term to my ES query, but I cant seem to
figure out how to do that. In my particular case I want the geo
radial bounding box to apply to all my facets and it appears that
adding the geoDistanceFilter() via setFilter() does not apply to
facets (which I think is normal). I was looking for something like
QueryBuilders.geoDistanceQuery() in the javaApi, but that doesn’t seem
to exist.

I suggest you gist an example of the query that you're using, so we can
figure out where you're going wrong. See
http://www.elasticsearch.org/help

My guess is that you're using a "top-level" filter
(http://www.elasticsearch.org/guide/reference/api/search/filter.html )
instead of a filtered query
(http://www.elasticsearch.org/guide/reference/query-dsl/filtered-query.html )

clint


(Shay Banon) #2

If you want to apply filters just for specific facets, then you can set a filter on the relevant facets. In Java, each facet has a facetFitler method that accepts a filter (can be a geo bounding box filter).
On Monday, May 9, 2011 at 10:59 PM, Clinton Gormley wrote:

Hi Ben

I am an ES beginner possibly migrating from Solr and I am trying to
apply a geo distance query term to my ES query, but I cant seem to
figure out how to do that. In my particular case I want the geo
radial bounding box to apply to all my facets and it appears that
adding the geoDistanceFilter() via setFilter() does not apply to
facets (which I think is normal). I was looking for something like
QueryBuilders.geoDistanceQuery() in the javaApi, but that doesn’t seem
to exist.

I suggest you gist an example of the query that you're using, so we can
figure out where you're going wrong. See
http://www.elasticsearch.org/help

My guess is that you're using a "top-level" filter
(http://www.elasticsearch.org/guide/reference/api/search/filter.html )
instead of a filtered query
(http://www.elasticsearch.org/guide/reference/query-dsl/filtered-query.html )

clint


(system) #3