Note that there are some explanatory texts on larger screens.

plurals
  1. POSolr 4 Spatial Query Filter still returns documents out of range
    text
    copied!<p>The Target is to perform multisort by score then distance, and to limit to a radius of 0.14 degrees I perform the following query:</p> <pre><code>localhost:8983/solr/coll1/select?sortsq={! score=distance}locations:"Intersects(Circle(34.0031792,-118.3082034 d=0.14))"&amp;fl=score,distdeg:query($sortsq),*&amp;facet=true&amp;sort=score desc,query($sortsq) asc&amp;indent=on&amp;wt=xml&amp;version=2.2&amp;rows=10&amp;start=0&amp;q=text:*&amp;facet.field=xxxxx&amp;fq=fieldname:"filterValue" </code></pre> <p>All the documents matching the query are returned, whether it is within the circle or not, but the ones that within the 0.14 degrees returns the distance (distdeg), and the others does not have that field returned. </p> <p>How can I omit the non-intersecting documents?</p> <p>locations field declaration: </p> <pre><code>&lt;fieldType name="geo_field" class="solr.SpatialRecursivePrefixTreeFieldType" spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" distErrPct="0.025" maxDistErr="0.000009" units="degrees" /&gt; </code></pre> <p><strong>Update:</strong> Working Version of the query</p> <pre><code>http://localhost:8983/solr/coll1/select?getDist={! score=distance}locations:"Intersects(Circle(34.0031792,-118.3082034 d=0.14))"&amp;fl=score,distdeg:query($getDist),*&amp;facet=true&amp;sort=score desc&amp;indent=on&amp;wt=xml&amp;version=2.2&amp;rows=10&amp;start=0&amp;q=*:*&amp;boost=query({! score=distdeg filter=false v=$getDist)&amp;fq=locations:"Intersects(Circle(34.0031792,-118.3082034 d=0.14))",states:"CA" </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload