Search Builder is case-sensitive. How to change? N.B. Editor examples not working
Search Builder is case-sensitive. How to change? N.B. Editor examples not working
robsimpson
Posts: 36Questions: 8Answers: 1
N.B. The three SB Editor examples at https://editor.datatables don't work - no conditions are shown in drop-down.
My search, and column searches, are (as desired) case-insensitive.
Search Build is case-sensitive. Can this be changed?
Thanks, Rob
This question has accepted answers - jump to:
Answers
Should have added, this is serverside
Yes apologies about those examples. I need to rebuild and deploy the site along with a SearchBuilder release (for this fix).
It is controlled at the server-side when server-side processing. What script are you using?
Allan
nodejs
With our server-side libraries? What database type are you using? With Postgres you would probably need to use
lower()
on search term and column, which isn't going to be trivial to add to the libraries.Allan
Yes, I am using your libraries.
It seems odd that case is insensitive for clientside processing, but not supported in serverside. Insensitive is quite typically to come across (e.g. Excel), particularly when searching freeform data.
Could you point me to the script that does the query build, so I could look at adapting it, or is that hopelessly naive of me?
thanks,
Rob
Hi Rob,
I agree - I hadn't clicked on that distinction before, but I'd prefer to see it being case insensitive as well for "contains" and similar conditions.
This is the part of the code that is relevant, but it isn't quite as simple as changing
LIKE
forILIKE
, unless you are using Postgres. Not all other database types we support haveILIKE
support - they would either need a case insensitive collation for your database, table or column - or an upper / lower transformation on the data (but that will mess up any indexes).My inclination is to suggest that you are use a case insensitive collation, unless you are using Postgres, in which case we could look at adding a switch in there to make it ILIKE.
Allan
I am using Postgres, actually.
I don't know how much effort that would be for you, but frankly I looking into writing my own back end as the main hurdle I have now is the searchPane counts ignoring other searches. I've already written one to parse the searches to provide statistics on the selected data, but I have a couple of questions on that which I will raise in another thread.
Thanks so much for quick input, again!
Rob