4

The site only has documentation for JSON, but not the Java client. Is there some sort of mapping I should be performing?

For example geo location queries: http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-range-filter.html

How would such a query be written using the Java client?

Thanks Jason

2
  • 5
    elasticsearch.org/guide/reference/java-api/client.html is that what you are looking for ? Commented Oct 21, 2011 at 21:49
  • It's close, but I still don't understand how to perform a Geo distance range filter query using the Java client. An example would be great! Commented Oct 22, 2011 at 6:42

1 Answer 1

5

Not obvious but not that complicated ;)

SearchRequestBuilder srb = client.prepareSearch(index);                
srb.setQuery(QueryBuilders.matchAllQuery());
srb.setFilter(FilterBuilders.geoDistanceRangeFilter("filter1").lat(1234).lon(4321).geoDistance(GeoDistance.PLANE) ..... );
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.