Bob, I think I see what is going on....
With 4.0-8 in this sample (according to what I tried), adding a geo index with "point" format returns the document. Adding it with "long-lat-point" format does not return the document. With no index, it returns the document, just like with point. I am not sure if there was a bug fixed in this area between 4.0-4 and 4.0-8 or not, but it does appear to do the right thing in 4.0-8. I did not try it with 4.0-4. Later versions of the server have this to say (in the help) about the format: point format describes the point format in the data: "point" means latitude precedes longitude; "long-lat-point" means longitude precedes latitude. This would explain why if you got that switch flipped it would not return the document (because the long-lat values would be flipped). (it would only match in the case where the lat and long values happen to be the same...) So make sure you have it set to "point" and not to "long-lat-point". If the problem persists, you might consider upgrading to 4.0-8 (which is a good idea anyway). -Danny From: [email protected] [mailto:[email protected]] On Behalf Of Bob Runstein Sent: Thursday, April 22, 2010 9:53 AM To: [email protected] Subject: [MarkLogic Dev General] re: Geospatial index bug in version 4.0-4 Hi Geert, Yes. There is no error in the log. When running this from cq it shows "your query returned an empty sequence". Bob -------------------------------------------------------------------- Hi Bob, Did you check the errorlog? It might have thrown an error (which explains the not finding).. Kind regards, Geert > drs. G.P.H. (Geert) Josten Consultant Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 mailto:[email protected] http://www.daidalos.nl/ KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Bob Runstein > Sent: donderdag 22 april 2010 16:31 > To: [email protected] > Subject: [MarkLogic Dev General] RE: Geospatial index bug in > version 4.0-4 > > Hi Danny, > > A couple of notes. It was version 4.0-4 that I had the issue > with. With that version my query returns the document PRIOR > to adding a Geospatial Element Index on gml:pos. After I add > the index ([point] :/@http://www.opengis.net/gml:pos > <http://localhost:8121/images/varspace.gif> ) and reindexing > has completed the query does not return the document. > > Bob > > > --------------------------------------------------------------------- > > Message: 2 > Date: Wed, 21 Apr 2010 15:23:52 -0700 > From: Danny Sokolsky <[email protected]> > Subject: RE: [MarkLogic Dev General] Geospatial index bug in version > 4.0-4 > To: General Mark Logic Developer Discussion > <[email protected]> > Message-ID: > > <[email protected]> > Content-Type: text/plain; charset="us-ascii" > > I just tried it on 4.0-8 and it does indeed return the > document. I did a document-insert of the document, then ran > the exact query you gave. It returned the document. > > -Danny > > From: [email protected] > [mailto:[email protected]] On Behalf Of > Bob Runstein > Sent: Wednesday, April 21, 2010 7:24 AM > To: [email protected] > Subject: [MarkLogic Dev General] Geospatial index bug in version 4.0-4 > > Hi, > > I have a Geospatial Element Index on gml:pos. > > Given the following document: > <doc xmlns:gml="http://www.opengis.net/gml"> > <gml:pos>33 44</gml:pos> > <gml:pos>33 45</gml:pos> > </doc> > > The following query returns it on version 4.1-5, but returns > no results on version 4.0-5. > > let $query := > <cts:and-query> > <cts:element-geospatial-query> > <cts:option>coordinate-system=wgs84</cts:option> > <cts:region xsi:type="cts:point" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">33,44</c > ts:region> > <cts:element > xmlns:gml="http://www.opengis.net/gml">gml:pos</cts:element> > </cts:element-geospatial-query> > <cts:element-geospatial-query> > <cts:option>coordinate-system=wgs84</cts:option> > <cts:region xsi:type="cts:point" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">33,45</c > ts:region> > <cts:element > xmlns:gml="http://www.opengis.net/gml">gml:pos</cts:element> > </cts:element-geospatial-query> > > </cts:and-query> > > return cts:search(fn:doc(), cts:query($query)) > > If I omit one of the cts:element-geospatial-querys from the > cts:and-query, I get results on both versions. > > Is this a known bug that was fixed after version 4.0-5? > > Bob > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
