svySearch not finding integers on search

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

svySearch not finding integers on search

Postby roddy » Thu Jun 10, 2021 1:15 am

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.
roddy
 
Posts: 80
Joined: Mon Oct 26, 2020 12:32 am

Re: svySearch not finding integers on search

Postby sean » Thu Jun 10, 2021 11:49 pm

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.
Software Engineer
Servoy USA
sean
 
Posts: 290
Joined: Mon May 21, 2007 6:26 pm
Location: USA


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 6 guests

cron