Skip to content

Commit

Permalink
HSEARCH-3062 Comment the workaround to extract distance
Browse files Browse the repository at this point in the history
  • Loading branch information
fax4ever committed Aug 8, 2019
1 parent 613b857 commit 892ed77
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -36,6 +36,9 @@ class ElasticsearchDistanceToFieldProjection implements ElasticsearchSearchProje
" if (doc[params.fieldPath].size() != 0) {" +
" result = doc[params.fieldPath].arcDistance(params.lat, params.lon);" +
" } else {" +
// At the moment it seems that there is no way to apply #arcDistance on a nested object field.
// To workaround this limit we extract the geo point JSON source
// and we will compute the distance on client side.
" String nestedPath = params.nestedPath;" +
" String relativeFieldPath = params.relativeFieldPath;" +
" if (params['_source'][nestedPath] == null) return result;" +
Expand Down

0 comments on commit 892ed77

Please sign in to comment.