Calculating ArcDistance of a geopoint field within an object field


(Umami) #1

I am trying to obtain geodistance values for records in cases where
geodistance is not the primary purpose of the search (i.e. do not want it
to affect score/sort not included in a query/filter), but where that
information might be useful anyway.
As outlined in these example cases
https://gist.github.com/alexeiemam/04eda6fff5915f9cef66, script_field can
be used to obtain geodistance on a top level geopoint (example 3), but not
within an object field with geopoint fields (examples 4 and 5). Sorting by
geodistance, however, deals with geopoints within object fields without
issue (examples 1 and 2).
Is there any way to access these distance values outside of sorting?
Are there any known workarounds or suggestions?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e46093f9-d9a1-41ea-83bc-587219cf44aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Binh Ly-2) #2

Strange. The only thing I can think of is you have a document that does not
have a value for the field: doc.all_places.location_point. Can you narrow
down your search to only documents that contain that field and check?
Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b06501d5-7031-4ea3-831c-1b7ffdc2a190%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Umami) #3

In the linked example I have only one record, and it contains data for all fields.

On 16 Apr 2014, at 18:57, "Binh Ly" <binhly_es@yahoo.commailto:binhly_es@yahoo.com> wrote:

Strange. The only thing I can think of is you have a document that does not have a value for the field: doc.all_places.location_point. Can you narrow down your search to only documents that contain that field and check? Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/eg0_wuHMKH4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscribe@googlegroups.commailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b06501d5-7031-4ea3-831c-1b7ffdc2a190%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/b06501d5-7031-4ea3-831c-1b7ffdc2a190%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

This communication is from Chapter Media Limited. This email (including any attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information. If you are not the intended recipient, please do not read, distribute, copy or otherwise use this communication or the information in it. Any views or opinions expressed in this email may be solely those of the author and are not necessarily those of Chapter Media Limited

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/53E8A08F-E170-466E-8BB5-D7A9C1303651%40chaptermedia.com.
For more options, visit https://groups.google.com/d/optout.


(Umami) #4

In the linked example I have only one record, and it contains data for all fields.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8bf32028-6161-4ef0-9163-100fd0526ce7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Umami) #5

Apologies the #create document section of the gist was incorrectly
repeating the index mapping
I have updated
it: https://gist.github.com/alexeiemam/04eda6fff5915f9cef66#file-es_geo_distance-sh-L23

On Wednesday, April 16, 2014 6:57:45 PM UTC+1, Binh Ly wrote:

Strange. The only thing I can think of is you have a document that does
not have a value for the field: doc.all_places.location_point. Can you
narrow down your search to only documents that contain that field and
check? Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a4bba25c-34cf-402f-924b-798dc6bd9381%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #6