koopjs / koop-provider-marklogic

A Koop Provider that can be used to exposed data in MarkLogic via Esri feature services
https://koopjs.github.io/koop-provider-marklogic/
Other
6 stars 11 forks source link

Index path construction and unfiltered searches #72

Closed mfgumban closed 6 years ago

mfgumban commented 6 years ago

I've encountered an issue with unfiltered searches and how paths are defined for geospatial indexes.

Using the example content we use the following structured query:

<query xmlns="http://marklogic.com/appservices/search">
  <term-query>
    <text>berlin</text>
  </term-query>
  <geospatial-constraint-query>
    <constraint-name>Location</constraint-name>
    <box>
        <south>-5</south>
        <west>-28</west>
        <north>37</north>
        <east>40</east>
    </box>
  </geospatial-constraint-query>
</query>

where "Location" is a geo-path constraint. The expected results are 4 documents. If we remove the geospatial-constraint-query and retain the term-query, the expected results are 222 documents.

Using the original "//" path: //geometry[type = "Point"]//array-node("coordinates"):

If we remove "//": /geometry[type = "Point"]/array-node("coordinates")

If we try using "//" only at the start: //geometry[type = "Point"]/array-node("coordinates"), we get the same results as that of the original paths.

Has anyone encountered this in other environments? Using ML 9.0-3 at the moment.

jkerr5 commented 6 years ago

There were fixes to unfiltered geo searches in 9.0-4 so please upgrade and test that first.