By default, Search seems to assume columns are TEXT, by using lower(<fieldname>) in the search query. But I have integer fields, such as Year and various ID columns that I want to be searchable. Instead, we get an error:
Couldn’t execute query. ERROR: function lower(integer) does not exist LINE 1: …ation from xxx WHERE 1=1 AND ( LOWER(“year”)…
Do I need cast everything as text? Or is there a better way?
1 Answers
Hi,
This is used only with the databases (oracle, db2, postgres) which does not perform case insensitive searches in string.
The cast() solution will also work. You can also fix the search operator to equals in case of numeric (and avoid contains search):
$col["searchoptions"]["sopt"] = array("eq");
Your Answer