georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

Catalogue : Search by CSW : text search is (very) too wide #257

Open MaelREBOUX opened 4 years ago

MaelREBOUX commented 4 years ago

MapStore CSW request :

<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="4">
  <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>%vélo%</ogc:Literal>
        </ogc:PropertyIsLike>
      </ogc:Filter>
    </csw:Constraint>
  </csw:Query>
</csw:GetRecords>

103 metadatas returned

Mapfishapp CSW request

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results_with_summary" startPosition="1" maxRecords="20" xmlns:gmd="http://www.isotc211.org/2005/gmd">
  <csw:Query typeNames="csw:Record">
    <csw:ElementSetName>full</csw:ElementSetName>
    <csw:Constraint version="1.1.0">
      <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
        <ogc:And>
          <ogc:And>
            <ogc:Or>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>Type</ogc:PropertyName>
                <ogc:Literal>data</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>Type</ogc:PropertyName>
                <ogc:Literal>dataset</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>Type</ogc:PropertyName>
                <ogc:Literal>datasetcollection</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>Type</ogc:PropertyName>
                <ogc:Literal>series</ogc:Literal>
              </ogc:PropertyIsEqualTo>
            </ogc:Or>
          </ogc:And>
          <ogc:BBOX>
            <gml:Envelope xmlns:gml="http://www.opengis.net/gml">
              <gml:lowerCorner>-180 -90</gml:lowerCorner>
              <gml:upperCorner>180 90</gml:upperCorner>
            </gml:Envelope>
          </ogc:BBOX>
          <ogc:Or>
            <ogc:Or>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>Title</ogc:PropertyName>
                <ogc:Literal>vélo</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>AlternateTitle</ogc:PropertyName>
                <ogc:Literal>vélo</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>Identifier</ogc:PropertyName>
                <ogc:Literal>vélo</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo matchCase="true">
                <ogc:PropertyName>ResourceIdentifier</ogc:PropertyName>
                <ogc:Literal>vélo</ogc:Literal>
              </ogc:PropertyIsEqualTo>
            </ogc:Or>
            <ogc:And>
              <ogc:Or>
                <ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="." escapeChar="!">
                  <ogc:PropertyName>Title</ogc:PropertyName>
                  <ogc:Literal>vélo*</ogc:Literal>
                </ogc:PropertyIsLike>
                <ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="." escapeChar="!">
                  <ogc:PropertyName>AlternateTitle</ogc:PropertyName>
                  <ogc:Literal>vélo*</ogc:Literal>
                </ogc:PropertyIsLike>
                <ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="." escapeChar="!">
                  <ogc:PropertyName>Abstract</ogc:PropertyName>
                  <ogc:Literal>vélo*</ogc:Literal>
                </ogc:PropertyIsLike>
                <ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="." escapeChar="!">
                  <ogc:PropertyName>Subject</ogc:PropertyName>
                  <ogc:Literal>vélo*</ogc:Literal>
                </ogc:PropertyIsLike>
                <ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="." escapeChar="!">
                  <ogc:PropertyName>OrganisationName</ogc:PropertyName>
                  <ogc:Literal>vélo*</ogc:Literal>
                </ogc:PropertyIsLike>
              </ogc:Or>
            </ogc:And>
          </ogc:Or>
        </ogc:And>
      </ogc:Filter>
    </csw:Constraint>
    <ogc:SortBy xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:SortProperty>
        <ogc:PropertyName>Relevance</ogc:PropertyName>
        <ogc:SortOrder>DESC</ogc:SortOrder>
      </ogc:SortProperty>
    </ogc:SortBy>
  </csw:Query>
</csw:GetRecords>

12 metadatas returned

When GeoNetwork returns 13 metadatas.

Clearly : Mapstore2 return too much metadatas that do not match the query.

I strongly suggest to align to the current Mapfishapp query wich is suitable since years.

MaelREBOUX commented 3 years ago

Well. our alpha testers pointed out that behaviour. Need to discuss and prioritize.

MaelREBOUX commented 3 years ago

Good : cannot wait to test that !

Note for me : https://github.com/MuhweziDeo/MapStore2/commit/62b7050a438279f7a55d7ab644d24c4c7992e177#diff-3a386a6dba2b51b665c13451e244211a772223b7d40627d2a580aff473ef2cd9R72-R75

tdipisa commented 3 years ago

@MaelREBOUX what implemented for https://github.com/geosolutions-it/MapStore2/issues/6813 is necessary solve a specific issue related to the MS integration in GeoNode. It can be used as a basis for what is required in this issue which would require anyway more development (eg to make the filter configurable).

tdipisa commented 3 years ago

@MaelREBOUX we just opened an issue in MapStore for now here