Closed roddy-cesoft closed 3 years ago
Hi Roddy,
Thanks for using the SvySearch API.
What you observe is expected behavior for a numeric/integer field. All comparisons must be made in the database, so for text columns we can have a "starts-with" or "contains" functionality. But for a numeric column, the search will automatically switch to an exact match.
You could try a modifier that will work on a numeric, such as 1000...1999.
"implied" search means that a user doesn't have to type the column's alias in the search. When set to false, user must type it, i.e. "orderid:10249". It has no effect on the results of the search.
Thanks for getting back to me, I was hoping that the search would cast the integer to a string for comparison; is this possible to implement?
Hi Roddy, It's tricky but maybe possible. We have to evaluate it. I created a proper case you can track it: https://support.servoy.com/browse/SVYX-250
Thanks very much for evaluating it as a possible solution; I will follow along at the link provided.
Roddy
On Sat, 12 Jun 2021 at 00:30, Sean @.***> wrote:
Hi Roddy, It's tricky but maybe possible. We have to evaluate it. I created a proper case you can track it: https://support.servoy.com/browse/SVYX-250
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Servoy/svySearch/issues/24#issuecomment-859622541, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARKY46PFFFJLDVV2AESAY73TSIMXJANCNFSM46M7MVBQ .
Hi @roddy-cesoft I pushed a fix for this.
You can set that a specific search provider is casting integer to text in a query. i.e.
simpleSearch.addSearchProvider('orderid').setCastInteger(true);
It will be available in the next release (1.3.1) Please test from source for in the meantime.
Thanks, that is great :-)
1.3.1 released this morning, also put it in the webinar ;-)
I am using svySearch in my form and I am getting inconsistent results on my searching; especially when trying to search for integers.
For example, I have 10 invoice numbers starting with 107 (one of them is 10790); I only get a result from the search when I type in the whole '10790'.
This implies that the search has setImpliedSearch() is false for integer columns, even when I explicitly set it to true. I have tried this with the invoice number being the only search provider (there is no relationship involved) and with others.