You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2021/06/23 17:42:30 UTC

[solr] branch main updated: SOLR-15491: Adding example to return distance field. (#186)

This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new c1d0a75  SOLR-15491: Adding example to return distance field. (#186)
c1d0a75 is described below

commit c1d0a757fc0460230dfb9feefbfd66f13863fbfe
Author: Jeff Zemerick <je...@mtnfog.com>
AuthorDate: Wed Jun 23 13:42:21 2021 -0400

    SOLR-15491: Adding example to return distance field. (#186)
    
    Co-authored-by: jzonthemtn <jz...@opensourceconnections.com>
---
 solr/solr-ref-guide/src/spatial-search.adoc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/solr/solr-ref-guide/src/spatial-search.adoc b/solr/solr-ref-guide/src/spatial-search.adoc
index 050ac40..0ae872d 100644
--- a/solr/solr-ref-guide/src/spatial-search.adoc
+++ b/solr/solr-ref-guide/src/spatial-search.adoc
@@ -210,6 +210,13 @@ Using the <<the-dismax-query-parser.adoc#,DisMax>> or <<the-extended-dismax-quer
 [source,text]
 &q.alt=*:*&fq={!geofilt}&sfield=store&pt=45.15,-93.85&d=50&bf=recip(geodist(),2,200,20)&sort=score desc
 
+=== Returning Distance as a Field
+
+To return the distance as a pseudo field you can use the `geodist()` function in the field list.
+
+[source,text]
+&fl=distance:geodist()
+
 == RPT
 
 RPT refers to either `SpatialRecursivePrefixTreeFieldType` (aka simply RPT) and an extended version: