[ https://issues.apache.org/jira/browse/SOLR-8636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17268624#comment-17268624 ]
Famas edited comment on SOLR-8636 at 1/20/21, 2:53 PM: ------------------------------------------------------- Thank you for your answer [~dsmiley] so maybe the best quick solution is to add another field having a `location` type, for example: <field name="geo" type="location_rpt" multiValued="true" indexed="true" stored="true"/> <field name="geo_for_disatance" type="location" indexed="true" required="false" stored="false"/> The problem that I'm facing wish is the right query to execute to retrieve plogons results around my point. If we have a geo point with lat, lan `(4.0652 44.1518)` What's the right way to use geodist() in order to search for the results based on *geo* field and display distance on each result based on *geo_for_disatance* field? ```/select?fl=*,_dist_:geodist()&sfield=geo_for_disatance&fq=\{!geofilt sfield=geo pt="4.0652 44.1518" d=6}&pt=4.0652 44.1518&q=*:*``` ? Is it correct ! was (Author: famas): Thank you for your answer [~dsmiley] so maybe the best quick solution is to add another field having a `location` type, for example: <field name="geo" type="location_rpt" multiValued="true" indexed="true" stored="true"/> <field name="geo_for_disatance" type="location" indexed="true" required="false" stored="false"/> The problem that I'm facing wish is the right query to execute to retrieve plogons results around my point. If we have a geo point with lat, lan `(4.0652 44.1518)` What's the right way to use geodist() in order to search for the results based on *geo* field and display distance on each result based on *geo_for_disatance* field? /select?fl=*,_dist_:geodist()&sfield=geo_for_disatance&fq=\{!geofilt sfield=geo pt="4.0652 44.1518" d=6}&pt=4.0652 44.1518&q=*:* ? Is it correct ! > Incorrect distance returned for indexed polygon shapes > ------------------------------------------------------ > > Key: SOLR-8636 > URL: https://issues.apache.org/jira/browse/SOLR-8636 > Project: Solr > Issue Type: Bug > Components: spatial > Affects Versions: 5.2.1 > Reporter: Rahul Jain > Assignee: David Smiley > Priority: Major > > We have a location_rpt field with multivalued=true and we are indexing > multiple shapes of type LINESTRING() in a single spatial field per document. > We are using JTS for spatial and polygon indexing and filtering. > Solr query: > q={!geofilt sfield=geo pt=-27,153 score=distance d=50}&fl=*,score > For above query, we get the results perfectly fine (i.e. documents with at > least one intersecting shape is returned) but the returned distance has > following behavior: > 1. When only shapes (LINESTRING(), LINESTRING()) are indexed then the > distance returned is 180 degrees or 20015.115 kms. > 2. When only points are indexed then the distance to nearest point is > returned. > 3. When both points and shapes are indexed, distance to nearest point is > returned. > Using above distance in sorting causes sorting to go haywire. > Does Solr not return the distance it used during document filtering? Is there > a workaround or am I doing something wrong? -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org