[MarkLogic Dev General] Sample XQuery Geo Query Please
Mary Holstege
mary.holstege at marklogic.com
Mon Mar 5 10:23:11 PST 2012
On Mon, 05 Mar 2012 09:45:27 -0800, Tom Hubschman
<tom.hubschman at warriorgateway.org> wrote:
> Would somebody be so kind as to email me a sample query, which could
> be executed in CQ, that queries a database of documents using both a
> keyword AND a circle 100 miles from the radius of a point? Below is the
> document structure and I have highlighted the latitude and longitude
> tags. Thanks so much!
Something like this (assuming right binding for 'wg' prefix)
cts:search( doc(),
cts:and-query((
"some word or phrase",
cts:element-pair-geospatial-query(
xs:QName("wg:physical-address"),
xs:QName("wg:latitude"),
xs:QName("wg:longitude"),
cts:circle(100, cts:point(43.2,-112.2)))
))
)
If you want good performance you'll need to have
an element pair geospatial range index set up
on the same triple.
//Mary
More information about the General
mailing list