[ 
https://issues.apache.org/jira/browse/USERGRID-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14970335#comment-14970335
 ] 

David Johnson edited comment on USERGRID-926 at 10/23/15 2:48 PM:
------------------------------------------------------------------

Some notes from my work so far on this:

1) Query index must include distance in CandidateResult

- But ElasticSearch does not return distance except when sort by distance 
http://stackoverflow.com/questions/9295118/return-distance-in-elasticsearch-results
- Have to use a score_script in Groovy to calculate distance, by default Groovy 
scripting is disabled in ES 
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html
- Script is expensive so we only want to do it for geo queries

2) Core module must copy distance field from CandidateResult to Entity

3) GeoPaging test must check for distance in query response



was (Author: djohnson):
Some notes from my work so far on this:

1) Query index needs to include distance in CandidateResult

- But ElasticSearch does not return distance except when sort by distance 
http://stackoverflow.com/questions/9295118/return-distance-in-elasticsearch-results
- Do we even support sort by distance?
- Have to use a “script” to calculate distance
- How expensive is that script? OK to do it on all queries

2) Core module needs to copy from CandidateResult to Entity

3) GeoPaging test should check for distance in query response


> Include distances in geoquery responses
> ---------------------------------------
>
>                 Key: USERGRID-926
>                 URL: https://issues.apache.org/jira/browse/USERGRID-926
>             Project: Usergrid
>          Issue Type: Story
>            Reporter: Jeffrey 
>            Assignee: David Johnson
>             Fix For: 2.1.1
>
>
> The best place for this would be in the metadata of the results, in 
> metadata.distance perhaps.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to