5

On my GeoNetwork instance I can query search results by using the qi endpoint:

https://catalog-url/geonetwork/srv/eng/q?any=temperature+wms&fast=index&sortOrder=&resultType=details&sortBy=relevance&from=1&to=10&facet.q=

I wonder, how I can use the lucene query parser syntax for customizing search results?

It is possible to use the ? or * operators for wildcard searches, but the other operators does not seem to work as expected.

If I just search for e.g. 'temperature wms', it returns all results that contain both, temperature and wms keywords. The lucene website on the contrary says, this would work as the OR operator.

Also, the AND operator leads to no search results in my case, where it should give the result from the 'temperature wms' example instead (i.e. only datasets containing both keywords), according to the lucene page.

Is there a way to use the lucene query syntax with this endpoint at all? Or any other way to customize search for datasets by using advanced query syntax?

UPDATE:

I tried to dig a bit into the search classes of GeoNetwork. According to LuceneQueryBuilder, boolean AND and OR operators should actually be supported. Not yet sure, why it does not take effect in the q-interface search.

2
  • My understanding of both Lucene and Solr query syntax is you have to specify the or operator and that 'temperature wms' would be expected to return all results with both or either, that is and/or. Commented Dec 6, 2016 at 8:44
  • That was my expectation too. But the link I posted to the lucene page says different, in my understanding. Anyway, from the GeoNetwork interface, it seems to me, the lucene syntax is not respected.
    – ulrich
    Commented Dec 8, 2016 at 11:52

2 Answers 2

2

After searching for a long time, finally figured it out.

You have to use two "+" operator to enclose "or", something like this should work "any=temperature+or+wms"

1

This does not actually answer the given question, but solves the problem of fine-grained search results for me.

Instead of using the q-Interface search, I now use the CSW-endpoint, which allows to specify search parameters more detailed in a GetRecords request.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.