[GeoNetwork-users] Bounding box search with xml.search

Hi,

I have problems to execute a bounding box search via the xml.search interface. The bounding box parameters are not getting picked up.

Test query:
http://localhost:8083/geonetwork/srv/en/xml.search?eastBL=105.2501742381909&westBL=104.9925419721962&northBL=8.7549600735612&southBL=8.497841904777&start=1&to=3&relation=overlaps
The result gives me all records, not, as required, filtered by the specified bbox parameters.

In comparison, when I execute
http://localhost:8083/geonetwork/srv/en/main.search.embedded?eastBL=105.2501742381909&westBL=104.9925419721962&northBL=8.7549600735612&southBL=8.497841904777&start=1&to=3&relation=overlaps
results get filtered correctly.

Do I need to enable such a geo search for xml.search in XSL files (such as lucene.xsl)?

I'm using Geonetwork 2.4.2, Tomcat6, Fedora12

Thanks for your help
Frank

The log output is:
651903 [http-8083-1] DEBUG jeeves.service - -> parameters are :
<request>
<northBL>8.7549600735612</northBL>
<southBL>8.497841904777</southBL>
<eastBL>105.2501742381909</eastBL>
<relation>overlaps</relation>
<to>3</to>
<start>1</start>
<westBL>104.9925419721962</westBL>
</request>
651904 [http-8083-1] INFO xml.search - Creating searchers
651904 [http-8083-1] DEBUG geonetwork.search - CRITERIA:
<request>
<northBL>8.7549600735612</northBL>
<southBL>8.497841904777</southBL>
<eastBL>105.2501742381909</eastBL>
<to>3</to>
<start>1</start>
<westBL>104.9925419721962</westBL>
<group>1</group>
<group>0</group>
</request>
651965 [http-8083-1] DEBUG geonetwork.search - XML QUERY:
<BooleanQuery>
<BooleanClause required="true" prohibited="false">
<BooleanQuery>
<BooleanClause required="false" prohibited="false">
<TermQuery fld="_op0" txt="1" />
</BooleanClause>
<BooleanClause required="false" prohibited="false">
<TermQuery fld="_op0" txt="0" />
</BooleanClause>
</BooleanQuery>
</BooleanClause>
<BooleanClause required="true" prohibited="false">
<TermQuery fld="_isTemplate" txt="n" />
</BooleanClause>
</BooleanQuery>
651965 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _op0:1
651965 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _op0:0
651965 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _op0:1 _op0:0
651966 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _isTemplate:n
651966 [http-8083-1] DEBUG geonetwork.search - Lucene Query: +(_op0:1 _op0:0) +_isTemplate:n
651966 [http-8083-1] DEBUG geonetwork.search - Sorting by : relevance
651966 [http-8083-1] DEBUG geonetwork.search - Sorting by : [relevance,true]
651973 [http-8083-1] DEBUG geonetwork.search - Hits found : 10821
653332 [http-8083-1] DEBUG geonetwork.search - Hits found : 10821

I debugged this issue a bit more and found a solution for us. The problem seems to be that the 'relation' request parameter is not being passed correctly to the org.fao.geonet.kernel.search.LuceneSearcher.java and therefore the bbox is not included in the Lucene query.

I could fix the issue by changing the following line in org.fao.geonet.services.main.XmlSearch.java from

searcher.search(context, params, _config);
to
searcher.search(context, elData, _config);

Not sure if my fix is correct, as I don't understand yet the complete internal search execution flow, but the bbox search is now working properly.

I'm using source code version of GN 2.4.2

Any comments appreciated
best regards,
Frank

On 23/03/10 11:46, FrankL wrote:

Hi,

I have problems to execute a bounding box search via the xml.search interface. The bounding box parameters are not getting picked up.

Test query:
http://localhost:8083/geonetwork/srv/en/xml.search?eastBL=105.2501742381909&westBL=104.9925419721962&northBL=8.7549600735612&southBL=8.497841904777&start=1&to=3&relation=overlaps
The result gives me all records, not, as required, filtered by the specified bbox parameters.

In comparison, when I execute
http://localhost:8083/geonetwork/srv/en/main.search.embedded?eastBL=105.2501742381909&westBL=104.9925419721962&northBL=8.7549600735612&southBL=8.497841904777&start=1&to=3&relation=overlaps
results get filtered correctly.

Do I need to enable such a geo search for xml.search in XSL files (such as lucene.xsl)?

I'm using Geonetwork 2.4.2, Tomcat6, Fedora12

Thanks for your help
Frank

The log output is:
651903 [http-8083-1] DEBUG jeeves.service - -> parameters are :
<request>
<northBL>8.7549600735612</northBL>
<southBL>8.497841904777</southBL>
<eastBL>105.2501742381909</eastBL>
<relation>overlaps</relation>
<to>3</to>
<start>1</start>
<westBL>104.9925419721962</westBL>
</request>
651904 [http-8083-1] INFO xml.search - Creating searchers
651904 [http-8083-1] DEBUG geonetwork.search - CRITERIA:
<request>
<northBL>8.7549600735612</northBL>
<southBL>8.497841904777</southBL>
<eastBL>105.2501742381909</eastBL>
<to>3</to>
<start>1</start>
<westBL>104.9925419721962</westBL>
<group>1</group>
<group>0</group>
</request>
651965 [http-8083-1] DEBUG geonetwork.search - XML QUERY:
<BooleanQuery>
<BooleanClause required="true" prohibited="false">
<BooleanQuery>
<BooleanClause required="false" prohibited="false">
<TermQuery fld="_op0" txt="1" />
</BooleanClause>
<BooleanClause required="false" prohibited="false">
<TermQuery fld="_op0" txt="0" />
</BooleanClause>
</BooleanQuery>
</BooleanClause>
<BooleanClause required="true" prohibited="false">
<TermQuery fld="_isTemplate" txt="n" />
</BooleanClause>
</BooleanQuery>
651965 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _op0:1
651965 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _op0:0
651965 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _op0:1 _op0:0
651966 [http-8083-1] DEBUG geonetwork.search - Lucene Query: _isTemplate:n
651966 [http-8083-1] DEBUG geonetwork.search - Lucene Query: +(_op0:1 _op0:0) +_isTemplate:n
651966 [http-8083-1] DEBUG geonetwork.search - Sorting by : relevance
651966 [http-8083-1] DEBUG geonetwork.search - Sorting by : [relevance,true]
651973 [http-8083-1] DEBUG geonetwork.search - Hits found : 10821
653332 [http-8083-1] DEBUG geonetwork.search - Hits found : 10821

Can you confirm if this issue remains present in Geonetwork 2.4.3?

Thanks in advice.
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Bounding-box-search-with-xml-search-tp4782405p5078394.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Henry2man wrote:

Can you confirm if this issue remains present in Geonetwork 2.4.3?

Ansewing myself: YES.

Under Geonetwork 2.4.3 Frank's first query (using "xml.search") generates
this output log:
278237 [4877503@anonymised.com] DEBUG jeeves.service - -> parameters are :
<request>
  <eastBL>105.2501742381909</eastBL>
  <southBL>8.497841904777</southBL>
  <northBL>8.7549600735612</northBL>
  <relation>overlaps</relation>
  <westBL>104.9925419721962</westBL>
</request>
278253 [4877503@anonymised.com] INFO xml.search - Creating searchers

LuceneQueryBuilder: request is
<request>
  <eastBL>105.2501742381909</eastBL>
  <southBL>8.497841904777</southBL>
  <northBL>8.7549600735612</northBL>
  <westBL>104.9925419721962</westBL>
  <group>1</group>
  <group>0</group>
</request>

LuceneQueryBuilder: query is
+(_op0:1 _op0:0) +_isTemplate:n
Wich means "relation" parameter is ignored. Buy, usign
"main.search.embedded" service relevant output log is:
LuceneQueryBuilder: query is
+(_op0:1 _op0:0) +_isTemplate:n +eastBL:[465.9925419721962 TO 540]
+westBL:[180 TO 464.2501742381909] +northBL:[369.497841904777 TO 450]
+southBL:[270 TO 367.7549600735612]
Is this an Issue of current implementation?
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Bounding-box-search-with-xml-search-tp4782405p5092863.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.