I want to filter columns in GeoServer WMS layer using 'ilike'. I tried following cql query.
"column_name" ilike 'string'
It works for columns of datatype string, not working for integer columns.
How to convert integer column into string using CQL ?
UPDATE
Usecase Example:
Lets say I have two columns in a WMS layer such as one is address and another is zipcode. Both address and zip code has numbers in their column, but zipcode is of datatype integer and address is of datatype string. Below is sample column.
Column
address
338/4 -yyy,zzz.
444/3 – zxy
323 – abc.
zipcode
33431
385493
30293
Now I want to run CQL query to pick rows even if one column has a search string. My query for search string '38' is like follows.
Query
address ilike '38' or zipcode ilike '38'
For the above query I want the result which contains first and second rows.
Result
address
338/4 -yyy,zzz.
444/3 – zxy
zipcode
33431
385493
Like this many layers, and so many columns. So changing query for each column is not easy.
Best Answer
Create a view into your database and cast numbers to strings with to_char https://www.postgresql.org/docs/9.3/static/functions-formatting.html. Publish the view with GeoServer and your numbers should be seachable with ilike.