[Geoserver-devel] [JIRA] (GEOS-8619) CSW Text search doesn't match layers with \n in abstract

Lorenzo Natali created an issue

GeoServer / BugGEOS-8619

CSW Text search doesn’t match layers with \n in abstract

Issue Type:

BugBug

Affects Versions:

2.12.2

Assignee:

Unassigned

Components:

CSW

Created:

07/Mar/18 10:38 AM

Priority:

MediumMedium

Reporter:

Lorenzo Natali

Layer’s that contains a \n in the abstract does not result anymore in CSW text search. If I remove the <Constraint> from the request, I have the result as expected.

steps to reproduce:

request:

curl -X POST \
  http://localhost:8080/geoserver/csw \
  -H 'accept: application/json' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/xml' \
  -H 'postman-token: ab0c9fb4-9c2b-3b41-6b47-56dde0918849' \
  -d '&lt;csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:ows="http://www.opengis.net/ows" service="CSW" version="2.0.2" resultType="results" startPosition="1" maxRecords="6"&gt;&lt;csw:Query typeNames="csw:Record"&gt;&lt;csw:ElementSetName&gt;full&lt;/csw:ElementSetName&gt;&lt;csw:Constraint version="1.1.0"&gt;&lt;ogc:Filter&gt;&lt;ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\\"&gt;&lt;ogc:PropertyName&gt;csw:AnyText&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;%states%&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsLike&gt;&lt;/ogc:Filter&gt;&lt;/csw:Constraint&gt;&lt;/csw:Query&gt;&lt;/csw:GetRecords&gt;'

response 1:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:ows="http://www.opengis.net/ows" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://localhost:8080/geoserver/schemas/csw/2.0.2/record.xsd"&gt;
    &lt;csw:SearchStatus timestamp="2018-03-07T08:50:26.600Z"/&gt;
    &lt;csw:SearchResults numberOfRecordsMatched="1" numberOfRecordsReturned="1" nextRecord="0" elementSet="full"&gt;
        &lt;csw:Record&gt;
            &lt;dc:identifier&gt;topp:states&lt;/dc:identifier&gt;
            &lt;dc:creator&gt;GeoServer Catalog&lt;/dc:creator&gt;
            &lt;dct:references scheme="OGC:WMS"&gt;http://localhost:8080/geoserver/wms?service=WMS&amp;amp;request=GetMap&amp;amp;layers=topp:states&lt;/dct:references&gt;
            &lt;dc:subject&gt;census&lt;/dc:subject&gt;
            &lt;dc:subject&gt;united&lt;/dc:subject&gt;
            &lt;dc:subject&gt;boundaries&lt;/dc:subject&gt;
            &lt;dc:subject&gt;state&lt;/dc:subject&gt;
            &lt;dc:subject&gt;states&lt;/dc:subject&gt;
            &lt;dct:abstract&gt;This is some census data on the states.&lt;/dct:abstract&gt;
            &lt;dc:title&gt;USA Population&lt;/dc:title&gt;
            &lt;dc:type&gt;http://purl.org/dc/dcmitype/Dataset&lt;/dc:type&gt;
            &lt;ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326"&gt;
                &lt;ows:LowerCorner&gt;24.955967 -124.73142200000001&lt;/ows:LowerCorner&gt;
                &lt;ows:UpperCorner&gt;49.371735 -66.969849&lt;/ows:UpperCorner&gt;
            &lt;/ows:BoundingBox&gt;
        &lt;/csw:Record&gt;
    &lt;/csw:SearchResults&gt;
&lt;/csw:GetRecordsResponse&gt;

  • then change topp:states layer abstract to:

This is some census data on the states.
This is some text after “over again”

{no<!-- … –>format}

note: featuretype.xml contains

&lt;!-- ... --&gt;
   &lt;abstract&gt;This is some census data on the states.&amp;#xd;
 This is some text after \n&lt;/abstract&gt;
&lt;!-- ... --&gt;

  • then for the same request you’ll obtain

response 2:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:ows="http://www.opengis.net/ows" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://localhost:8080/geoserver/schemas/csw/2.0.2/record.xsd"&gt;
    &lt;csw:SearchStatus timestamp="2018-03-07T08:54:45.589Z"/&gt;
    &lt;csw:SearchResults numberOfRecordsMatched="0" numberOfRecordsReturned="0" nextRecord="0" elementSet="full"/&gt;
&lt;/csw:GetRecordsResponse&gt;

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100081-sha1:75480ba)

Atlassian logo