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 '<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"><csw:Query typeNames="csw:Record"><csw:ElementSetName>full</csw:ElementSetName><csw:Constraint version="1.1.0"><ogc:Filter><ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\\"><ogc:PropertyName>csw:AnyText</ogc:PropertyName><ogc:Literal>%states%</ogc:Literal></ogc:PropertyIsLike></ogc:Filter></csw:Constraint></csw:Query></csw:GetRecords>'
response 1:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<csw:SearchStatus timestamp="2018-03-07T08:50:26.600Z"/>
<csw:SearchResults numberOfRecordsMatched="1" numberOfRecordsReturned="1" nextRecord="0" elementSet="full">
<csw:Record>
<dc:identifier>topp:states</dc:identifier>
<dc:creator>GeoServer Catalog</dc:creator>
<dct:references scheme="OGC:WMS">http://localhost:8080/geoserver/wms?service=WMS&amp;request=GetMap&amp;layers=topp:states</dct:references>
<dc:subject>census</dc:subject>
<dc:subject>united</dc:subject>
<dc:subject>boundaries</dc:subject>
<dc:subject>state</dc:subject>
<dc:subject>states</dc:subject>
<dct:abstract>This is some census data on the states.</dct:abstract>
<dc:title>USA Population</dc:title>
<dc:type>http://purl.org/dc/dcmitype/Dataset</dc:type>
<ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326">
<ows:LowerCorner>24.955967 -124.73142200000001</ows:LowerCorner>
<ows:UpperCorner>49.371735 -66.969849</ows:UpperCorner>
</ows:BoundingBox>
</csw:Record>
</csw:SearchResults>
</csw:GetRecordsResponse>
- 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
<!-- ... -->
<abstract>This is some census data on the states.&#xd;
This is some text after \n</abstract>
<!-- ... -->
- then for the same request you’ll obtain
response 2:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<csw:SearchStatus timestamp="2018-03-07T08:54:45.589Z"/>
<csw:SearchResults numberOfRecordsMatched="0" numberOfRecordsReturned="0" nextRecord="0" elementSet="full"/>
</csw:GetRecordsResponse>
|