A "search" control

Post your Gambas programming questions here.
Post Reply
User avatar
thatbruce
Posts: 168
Joined: Saturday 4th September 2021 11:29pm

A "search" control

Post by thatbruce »

I have started to build a new control to let me do searches into a database but I have come up with a few general questions. The main idea is to make searching for text as easy as possible (simple?). I am looking for both ideas and knowledge here.
1) What, in your experience, is the best example of a search control? Note, this doesn't need to be for a database, just some good ideas. For example the generic web browser search when looking at a pdf file isn't too bad but could be better. On the other hand the LibreOffice "Writer" search is a total overkill and I still can't get wildcard searches to work anyway.
2) I'm very good with postgres and fairly angry with sqlite but do the other databases support the postgres "ilike" operator? N.B. Not a typo!
3) What do you think about wildcarding? I would like to support some level of wildcards anywhere in the search term without resorting to bloody regular expressions. I am thinking of using something like "??" as a wildcard for anything, is that sensible (from a user point of view)?

All the internals I can handle.
b
Have you ever noticed that software is never advertised using the adjective "spreadable".
User avatar
cogier
Site Admin
Posts: 1127
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: A "search" control

Post by cogier »

Firstly, what I know about databases and quantum physics is about the same - NIL!

I have always relied on CSV files to store data. They do have their downsides, but they are fast and don't take up much room.
What do you think about wildcarding? I would like to support some level of wildcards anywhere in the search term without resorting to bloody regular expressions. I am thinking of using something like "??" as a wildcard for anything, is that sensible (from a user point of view)?
I presume you are looking to provide a search facility to people that might not grasp wild cards, regular expressions etc. Well, below is how I do this. The attached program only requires is a text entry (it is not case-sensitive), with an option for a second search.

Run the program enter australia in the first search. This will bring up 34 results. If you now add a second search raymond you will filter the search to a single row. This sample 'CSV database' contains 10,000 lines. All the data is false and just for demonstration purposes.

Image
Search-0.0.1.tar.gz
(805.71 KiB) Downloaded 160 times
Post Reply