Case insensitive filter not working

I have the following filter in openlayers 2.13

var filter_c = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.LIKE,
    property: 'strToLowerCase(p_name)',
    value: '%'+String(document.getElementById("nm").value).toLowerCase()+'%'
});

//pass the filter to the layer
var prot =  new OpenLayers.Protocol.WFS({
    url:  "/geoserver/wfs",
    featureType: "pins",
    featureNS: "http://www.mysite.gr",
    defaultFilter: filter_cl
});

var _CallBack = function(resp) {
    pins.addFeatures(resp.features)
    var cb = pins.features.length;
    if (cb == 0){alert("Nothing Found");}
};

var response = prot.read({callback: _CallBack});


//refresh to render POIs
pins.refresh({force:true});

I also use Geoserver 2.1.3 and PostgreSQL 9.1 / PostGIS 2.0.

This filter is case sensitive. How can I make this filter unacceptable?

The level pinstakes data from a table in postgreSQL / PostGIS. The names are in UTF8 and are Greek words such as Ακρόπολη, Παρθενώναςetc.

I just set it as pins = new OpenLayers.Layer.Vector("LayerTitle", {renderers: ["Canvas", "SVG", "VML"]}), and I have the above code to search for it.

When I use the filter, I do not receive a warning Nothing found, but I do not see the points on the map, and the map is scaled 100% in the center. So the filter is working. What am I missing?

thank

+3
source
1

, OpenLayers, GeoServer, geoserver, OpenLayers.

Geoserver, , , . . http://docs.geoserver.org/latest/en/user/styling/sld-reference/filters.html, , matchCase.

0

All Articles