Opened 10 years ago

Closed 10 years ago

#227 closed defect (fixed)

CSW converting query strings to lower case makes filter queries fail

Reported by: simonp Owned by: simonp
Priority: major Milestone: v2.5.1
Component: General Version: v2.5.0
Keywords: CSW Cc: t800t8@…

Description

Reported by t800t8:

I tried to find with literal 'OGC:WMS*' but the service return no result but it should return 2 results as expected.

Here is my filter query:

<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<PropertyIsLike? wildCard="*" singleChar="#" escapeChar="!"

matchCase="false">

<PropertyName?>protocol</PropertyName?> <Literal>OGC:WMS*</Literal>

</PropertyIsLike?>

</Filter>

Change History (2)

comment:1 Changed 10 years ago by simonp

I had a look at this particular case (still interested to hear about the others Abdi!). The problem is that the wild card query text (in this case OGC:WMS*) is being converted to lower case by the lucene query builder in src/org/fao/geonetwork/search/LuceneSearcher.java (makeQuery method). This is unfortunate because the protocol field against which this query is being run in Lucene is not tokenized (which is correct) and the protocol strings are all in upper case.

Proposed fix is to remove the blanket toLowerCase in the makeQuery method and apply the Analyzer that goes with the field being queried to the text provided in Filter query. eg. in this case the protocol field is not tokenized/analyzed so it should not be changed by the query parser.

comment:2 Changed 10 years ago by simonp

Cc: t800t8@… added
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.