node.js - Marklogic|NodeJS API facet query by geolocation -
so, have structure like
{ city: "city", geolocation: { lat: 55, lng:55 } }
and want count geolocation return city cannot facet geolocation work. created geospatial element index, geospatial element pair index , query tried following:
qb.facet("count", qb.property("geolocation")) qb.facet("count", qb.geopropertypair("geolocation", "lat", "lng")) qb.facet("count", qb.geoproperty("geolocation")) qb.facet("count", qb.geoelement("geolocation"))
and of these facet query empty or inexistent. doing wrong?
i'm able reproduce bug. while geospatial queries on json documents work, geospatial facets on json documents not working in rest api.
the workaround can see write custom constraint executes cts:geospatial-boxes() in xquery or cts.geospatialboxes() in javascript, install module on server, , refer custom constraint in query. more information, see:
http://docs.marklogic.com/guide/search-dev/search-api#id_49750
http://docs.marklogic.com/jsdoc/config.query.custom.html
Comments
Post a Comment