I am trying to write a WFS getfeature query for some GeoServer JSON data that returns features that match a part of a string only if the entire word matches. The word can be in the start, middle, or end of the string. I started by using cql_filter, but am returning records that don't match a whole word.

Say I have two features with the following values for AddLocID:

id, AddLocID  
1,  216  
2,  216 72216  
3,  72216 

I want to return features 1 & 2 and not feature 3

Using cql_filter=AddLocID=216 returns only feature 1 and does not match feature 2


Using cql_filter=AddLocID Like 216 returns all 3 features but I only want 1 and 2


How can a write my query so that records 1 and 2 are return that match 216 as a whole word in the string value?

1 Answer 1


You can use the isLike function which takes a full Java Rexep for the match. In your case you could use something like:


so that \b matches a word boundary. You may need to experiment with just how many \ will be required for it to work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.