Hi Frank!

This has been a popular topic lately :) See this recent discussion from the
users list:

http://old.nabble.com/case-insensitive-LIKE-filter..-td29820164.html

-Justin

On Thu, Sep 30, 2010 at 5:07 AM, Frank Gasdorf
<[email protected]>wrote:

> found an interesting discussion right here
>     http://getsatisfaction.com/opengeo/topics/cql_reference
> about default upper usage of the property Expression if using LIKE filters
> :
>
> What I try to do is using WFS to implement a gazetteer like search for
> point of interests. But the user typing the search text doesn't know about
> the type of storage (upper or lower case or even Camel Style or whatever).
>
> So is there a solution in geoserver 2.1.x to get results from a like query?
>
> Cheers
> Frank
>
> 2010/9/30 Frank Gasdorf <[email protected]>
>
> Hello everybody!
>>
>> I enabled the WFS service for my local geoserver installation and tried to
>> request features with a LIKE Filter to find features with a special name
>> attribute. But I couldn't create a case insensitive filter, where attribute
>> values and the filter criteria is uppercase.
>>
>>
>> FilterFactory2 filterFactory = CommonFactoryFinder.getFilterFactory2(
>> GeoTools.getDefaultHints() );
>> String attributeName = "nam";
>> String text = "hamburg*"
>> Expression upperAttribute = filterFactory.function("strToUpperCase",
>> filterFactory.property(attributeName));
>> Filter attributeFilter = filterFactory.like(upperAttribute,
>> text.toUpperCase(), "*", "?", "\\", false);
>>
>> the resulting filter looks like that:
>> [ strToUpperCase([nam]) is like HAMBURG* ]
>>
>> But I got no results back from the geoserver 2.0.2 WFS service.
>>
>> Could you give any hints to solve this problem? Any suggestions? Which
>> filters are supported by geoserver
>>
>> Thanks a lot,
>>
>> Frank
>>
>> PS: code snippet is used witth udig 1.2 on geotools 2.6.3
>>
>>
>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to