I use polygon searching using geo_polygon and it works very well, however I would like to refine the search results to receive only hits that would be in the same direction as my search.
In a user search, I determine a bearing which is a number between 0 and 360.
On the Elasticsearch side, I also have a bearing field.
I would like the search to filter the results that would have a bearing of more or less 90° (around a circle so reset to zero if greater than 360).
I hope I've made myself clear, if not, feel free to ask me for more details.
Unless I am fundamentally misunderstand the requirement regarding the bearing, this sounds like a boolean query with two clauses in the must part. One for the bearing and one for the geo polygon query.
Indeed, I managed to find a solution to my problem by putting a condition, the request must be should in the case where minBearing and maxBearing included 360° and in must the opposite case.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.