[Mapbender-commits] r10105 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Apr 16 02:43:12 PDT 2019
Author: armin11
Date: 2019-04-16 02:43:12 -0700 (Tue, 16 Apr 2019)
New Revision: 10105
Modified:
trunk/mapbender/http/php/mod_callCswMetadata.php
Log:
Fix for searching csw interface with more than one searchtext
Modified: trunk/mapbender/http/php/mod_callCswMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_callCswMetadata.php 2019-04-16 07:22:45 UTC (rev 10104)
+++ trunk/mapbender/http/php/mod_callCswMetadata.php 2019-04-16 09:43:12 UTC (rev 10105)
@@ -475,40 +475,40 @@
//************************************************************************************
//begin main program
//************************************************************************************
-$queryString = $searchText;
-$searchTextArray = explode(",",$queryString);
+//$queryString = $searchText;
+$searchTextArray = explode(",",$searchText);
-$queryText = $queryStringArray[0];
+//$queryText = $queryStringArray[0];
//if ($queryText == '*') {
// $queryText = '';
//} else {
-if (count($searchTextArray) > 1) {
+/*if (count($searchTextArray) > 1) {
$fullTextFilter = "<ogc:And>";
} else {
$fullTextFilter = "";
-}
-foreach($searchTextArray as $queryString) {
-
+}*/
+$fullTextFilter = "";
+//foreach($searchTextArray as $queryString) {
$fullTextFilter .= '<ogc:PropertyIsLike wildCard="*" singleChar="_" escapeChar="">';
$fullTextFilter .= '<ogc:PropertyName>AnyText</ogc:PropertyName>';
- if($queryString != '*'){
- $queryString = '*' . $queryString . '*';
- }
+ /*if($queryString != '*'){
+ $queryString = '*' . explode($queryString) . '*';
+ }*/
+ $queryString = '*' . implode("*", $searchTextArray) . '*';
$fullTextFilter .= '<ogc:Literal>'.$queryString.'</ogc:Literal>';
+ $fullTextFilter .= '</ogc:PropertyIsLike>';
+//}
- $fullTextFilter .= '</ogc:PropertyIsLike>';
-}
-if (count($searchTextArray) > 1) {
+/*if (count($searchTextArray) > 1) {
$fullTextFilter .= "</ogc:And>";
-}
+}*/
/*
$fullTextFilter .= '<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="">';
$fullTextFilter .= '<ogc:PropertyName>AnyText</ogc:PropertyName>';
$fullTextFilter .= '<ogc:Literal>%'.implode('%', $searchTextArray).'%</ogc:Literal>';
$fullTextFilter .= '</ogc:PropertyIsLike>';*/
-
//$e = new mb_exception("fulltextfilter: ".$fullTextFilter);
//}
$existsSpatialFilter = false;
@@ -547,11 +547,13 @@
$spatialFilter .= "/<ogc:BBOX>";
}
}
+
//combine filter
-if ($existsSpatialFilter == true && $queryText !== '' && $queryText !== '*'){
+//$e = new mb_exception("fullTextFilter: ".$fullTextFilter);
+if ($existsSpatialFilter == true && $searchText !== '' && $searchText !== '*'){
$additionalFilter = "<ogc:And>".$fullTextFilter.$spatialFilter."</ogc:And>";
} else {
- if ($queryText == '' || $queryText == '*') {
+ if ($searchText == '' || $searchText == '*') {
$additionalFilter = false;
} else {
$additionalFilter = $fullTextFilter;
More information about the Mapbender_commits
mailing list