Hi all,

I’m running on Solr 5.5 and have run into an issue where the Solr spatial
search is returning results outside of the search rectangle parameters, and
I’m not quite sure what is causing this to happen. Thank you in advance for
any troubleshooting tips you can pass along.



The spatial field, location_geo, is defined in the schema.xml as follows:

<fieldType name="geo" class="solr.SpatialRecursivePrefixTreeFieldType"
distErrPct="0.025" maxDistErr="0.000009" distanceUnits="degrees" />

<field name="location_geo" type="geo" indexed="true" stored="true"
multiValued="true" />



The spatial query parameters are as follows:

params

q     "*:*"

indent      "true"

fl    "id, location_geo"

fq    "location_geo:\"Intersects(ENVELOPE(-60, -55, 40, 37))\""

wt    "json"

debugQuery  "true"



The results include these records:

      {

        "id": "5230",

        "location_geo":
["ENVELOPE(-75.0,-75.93972222222223,39.359722222222224,38.28972222222222)"]

      },

      {

        "id": "9414",

        "location_geo": ["ENVELOPE(173.0,-10.0,84.0,8.0)"]

      },

      {

        "id": "5498",

        "location_geo":
["ENVELOPE(-75.0,-75.79972222222221,39.89972222222222,38.39972222222222)"]

      },

      {

        "id": "6023",

        "location_geo": ["ENVELOPE(-102.0,-35.0,37.0,35.5)"]

      }



The debug output is as follows:



  "debug": {

    "rawquerystring": "*:*",

    "querystring": "*:*",

    "parsedquery": "MatchAllDocsQuery(*:*)",

    "parsedquery_toString": "*:*",

    "explain": {

      "5230": "\n1.0 = *:*, product of:\n  1.0 = boost\n  1.0 =
queryNorm\n",

      "5498": "\n1.0 = *:*, product of:\n  1.0 = boost\n  1.0 =
queryNorm\n",

      "9414": "\n1.0 = *:*, product of:\n  1.0 = boost\n  1.0 =
queryNorm\n",

      "6023": "\n1.0 = *:*, product of:\n  1.0 = boost\n  1.0 = queryNorm\n"

    },

    "QParser": "LuceneQParser",

    "filter_queries": [

      "location_geo:\"Intersects(ENVELOPE(-60, -55, 40, 37))\""

    ],

    "parsed_filter_queries": [


"IntersectsPrefixTreeQuery(IntersectsPrefixTreeQuery(fieldName=location_geo,queryShape=Rect(minX=-60.0,maxX=-55.0,minY=37.0,maxY=40.0),detailLevel=5,prefixGridScanLevel=7))"

    ],



Thanks for any help and/or tips you can pass along.



Kind regards,
Leila

Reply via email to