Sorry, we don't support your browser.  Install a modern browser

Search for multiple / partial strings#549

W

Hi Milo

As per our emails last September, I would like to suggest that the global search is modified to allow searching of multiple words in the same record.

As an example - if I have a series of records…

1 - “V8 Red Truck”
2 - “V6 Red Truck”
3 - “V8 Red Car”
4 - “V6 Red Car”
5 - “V8 Blue Truck”
6 - “V6 Blue Truck”
7 - “V8 Blue Car”
8 - “V6 Blue Car”

At the moment if I search for “V8 Car” in the global search I get no results. If I want to get all results for “V8 Car”, I need to search for “V8” in global search, which results with records 1, 3, 5, 7 - then search in the specific field, containing the description, for “Car” and it will result in the correct records… 3 & 7.

There are occasions when much longer fields where I search for multiple words are completely missed!

If this feature is possible, it would be really useful to me and I suspect other developers too.

Thanks, Tony

a year ago

Hi Tony, just a fellow user here commenting on your good suggestion.

The words are in a single field..? Definitely possible I think, although I haven’t examined how the global search feature is executed in detail.

Most likely would impact search performance though, and because of that it should be an optional setting if implemented.

For example Google search handles this in a way that it would indeed find the correct ones when you search as follows, in quotes:
“V8 * Car”
But it would then also find these, if there were any, but probably wouldn’t be a problem in your use case:
“V8 Car”, “V8 Brown Classic Car” etc

I was about to ask however, if the information on color, engine and vehicle type could all be stored in separate columns, since for me that would make more sense in terms of filtering etc… but I suppose the table already has a large amount of data and there could be too much work to change the structure and so on.
But to my surprise this wouldn’t even help at all, because it seems the global search would still return no results for “V8 Car”. I see this as a potentially bigger shortcoming even, but there might be good reasons why the search behaves the way it does, not spanning/joining multiple columns to have a match.

a year ago
W

Hi Alex,

Thanks for the upvote - the reason the split columns wouldnt work in my specific environment, is because I have 2.5m lines of data which is imported from suppliers. Every hour a cron job on my server Truncates all the table in my database and re-imports the data from files uploaded to my FTP server by suppliers.

So, staff can quickly search supplier stock lists to see what they have. The fields I import include manufacturers part number, quantity in stock, cost proce, description, etc. So if staff search for a product by description, unless it is exact as per the description provided by the supplier, the search fails.

The example of Red/Blue/V8/V6/Car/Truck was just a simple way of describing the issue. But, as we dont create the data file, there is no easy way of creating new fields for each word in the suppliers description.

I used to present the data using a freeware solution calle Xataface which would provide results which contained multiple search terms… So my example above would work properly.

I think this improved search feature would be a very useful addon and as you say, it could be enabled/disabled using a tickbox so anyone who doesnt need it and would prefer the speed over funtionality could make that choice.

Sadly I am a power user rather than a developer, so am unable to offer script changes to make this work :(

It would be good to try and upvote this feature request to see if the developers are able to make this happen. When I spoke to Milo last year he seemed to think it would be a good feature as well.

Thanks

Tony

a year ago
W

I wonder whether it would be possible to have a new empty global search box available after one search… so using the above example you could search for “V8” and the result would be records 1, 3, 5 & 7… then have a ‘new’ global search box to search in these results… so for the second search you would look for “car” and that would present records 3 & 7 as the results??

a year ago

Hmm… then how about first doing a global search and then narrowing the results down with an individual column search:
https://wpdataaccess.com/docs/data-tables-interactive-filters/advanced-search/
I briefly tried only with the data on that demo, but maybe this could do what you need.

Oh wait… I now realized you described this already in your first post, so it is not a good option for you to do it like this..? I’m not sure if I fully understand.
If you’re conducting a search on search results, it would not be a global search anymore. So is it more about the placement of that second search box, so the search process would be as smooth and practical as possible..?

a year ago
W

Hi Alex, thanks for the comments… the precise issue which I would like to address is that the database I am accessing has about 2.5m lines of data and specifically this is IT equipment. So, for example, if I wanted to search for an HP Elitebook 840 G10 16Gb RAM, 256Gb SSD, Windows 11… Given that different suppliers will describe their products in many different ways… If I wanted to search for an Elitebook G10 16Gb 256Gb… obviously I can enter “Elitebook” in the global search and then maybe 16Gb in the description column search, but then how can I narrow the results down even more, if I want to reduce the results by searching the description column next by 256Gb… obviously this will delete the 16Gb I already searched for earlier.

The previous PHP/MySQL solution I was using was called Xataface and if I searched for “Elitebook G10 16Gb 256Gb” it would list any records with all of those terms in any configuration. So, it was as though it searched for “Elitebook”, then searched the results from this with “G10” then the results from this filter with “16Gb” and so on.

There must be a way of doing this, even if it was to create a number of concurrent search fields, so you could perhaps select how many search fields you want on your application to allow users to perform a search like “Elitebook” & “G10” & “16Gb” & “256Gb”.

Thanks

Tony

a year ago
1

A bit of a late comment perhaps, but here it goes, hopefully still something worth adding to the conversation.

Yeah, IT assets, a familiar subject for me also… from my previous life, so to speak.

As a developer-ish power user, I really like the idea you have described.

Especially if it would be an iterating search, where the default behavior for the search box would be to search again within the results until the user chooses to reset the search.

Yes, this probably could be also implemented as a “google-like search” which has been referred in several suggestions now.
However, performance-wise and also to serve your use-case maybe even better, I would ditch the global search approach and go for a new type of column filter, building on the existing column filter functionality.

You could have it enabled on a certain column only or maybe also simultaneously on several columns… but the key is to clear the search box automatically every time the results are narrowed down, then you could again type a new filtering value to the box. Most likely the already typed values should be visible, the same way you would be adding selectable values for a multi-select box, for example… having a small “x” where you could remove a value if desired, as opposed to clearing all values at once with a reset button.

I think this kind of feature would appeal to many power users… let’s hope this is doable and also gets more votes.

a year ago