I’m working on a project that uses ElasticSearch and tire.I have a google map on my web page.i want to get all properties when user draw apolygon on the map that must be fetched by Elastic search with tire. i have alreday get polygon coordinates now i want to write a query in (tire.serach Block see below) that will filter all properties within polygon area.Properties table of my database has longitude and latitide column. i can do this by using Postgis adapter but i need to know the syntax of query that will do this in tire/Elastic search.
def self.search(params={})
tire.search(load: true, page: params[:page], per_page: 50) do |search|
syntax of the filter query that will fetch all properties within user defined polygon area..???
end
end
Thanks
Ateq.
Something like:
Example adapted from Elasticsearch documentation on Geo Polygon Filter.