šŸ”Ž Glide: Search Box Tips and Tricks

Itā€™s not fun if it isnā€™t a challenge. :wink:

2 Likes

with you itā€™s always a challenge

2 Likes

Hi, I am sure that we can have something much more smart & accurate.
As a temporary solution, if the approach with a Single value & Template column use an Inline list filtered with ā€œIncludesā€ (or is included in), doesnā€™t it partly solve the AND-OR search?

If Iā€™m understanding @POWH_RPSā€™s request, they want to be able to type in multiple words and primarily, the search would return any matches where either, one of the words finds a matche, OR the other word finds a matche. Ideally an AND would also require all words to be found in a match, but would not require the words to be next to each other or in the same order in the searched text. If I understand your template and single value approach, it will search for any match within the template, but isnā€™t it true that the entire search string would have to find a match? So if I have a search of three words, all three would have to be found, in the same order, and next to each other in the text being searched. This is exactly what the built in search does already.

3 Likes

Right. Glide just needs to improve their search bar functionality.

4 Likes

Cool ! I can apply to be a Glide developer :slight_smile:

More seriously, based on your comments, I have to review how exactly my Template/SV approach delivers (once I enter some raw data to test it more deeply)

[EDIT] It is indeed an ā€œANDā€, and itā€™s logic ā€œis included inā€ is like AND ā€¦ Sorry @POWH_RPS, it does not answer your need. Thanks @Jeff_Hager for pointing out the issue

1 Like

Very interesting indeed! This would do what I am looking for. Can you share this last app?
Thanks.

After some working, I have solved my issue and created a much more powerful search tab. This has been realized by making the heavy lifting using Google Sheet functions, and organizing the tables in a Glide usable manner.
It is a little long to explain, but the concepts are the following:

I have created a new tab in GS to collect the search sentence that I can enter in Glide using a ā€œtext entryā€ field; in this tab, I have SPLIT the sentence into the various words and created a list of keywords, with a good measure of placing ā€œ*ā€ before and after the split word. These keywords with * wildcards now represent my search terms.

In the main data tab in GS, I have created 7 new columns (as I have limited to 7 words the advanced search) and I have used a mix of IF and MATCH functions to spit out ā€œOKā€ if I find a match of the search keywords within the row. Obviously, I repeat this on all the 7 columns for all the 7 keywords I have created. I have used a preliminary IFERROR function to create a blank result if the formula gives an error (N/A). Useful to know that the MATCH function recognizes the * wildcard symbol.

Done that, I have created a new column in the main data GS tab, called ā€œSelection ORā€. In this, using and IF/AND combination, I have generated ā€œOKā€ whenever I had at least one OK in the previous 7 columns of MATCH.

To conclude, I have created in Glide, in a dedicated details tab: a text entry to write the user search terms, an inline list filtered for the ā€œSelection ORā€ column, et voila, OR search is served.

I have also gone further in creating a Glide selector to use AND or OR to combine the search term and filtered a ā€œSelection ANDā€ column created in a similar manner, so to have an inline list this time filtered to an AND criterium. So now I also have an AND search available.

It took some time and is definitely not elegant.
Iā€™d much more prefer Glide to directly provide a more powerful search bar and close the deal!!!

Also because, I just realized, this convoluted trick DOES NOT allow to make user specific columns. So in the end also this does not really workā€¦

Hello @Jeff_Hager
I would like a clarification for your challenge :slight_smile:

the words between ā€œā€ are obligatory or exact, because it is not at all the same thing and the principle of research ??
If it is mandatory, the optional criteria are not necessary, but if it is optional, then we can make an ā€œand / orā€

1 Like

Hello @POWH_RPS
For the moment, it is still in the prototype phase, but I will make a point if I manage to finish.

1 Like

Hello,
With a little free time, I try to meet the challenge.

On the same approach as the ā€œGoogleā€ search.
Criterion :
ā€œRequired wordā€ Optional word

The order doesnā€™t matter.
I added the ā€œWordā€ options for a whole or partial word (partial useful when searching with an inline-list), ā€œIgnore Accentā€ option (for Latin people), ā€œuppercaseā€ option
I made a return as a string instead of the boolean, maybe easier for integration to a result array or whatever.

If the tests are good I will do a version for a search with an array or a joinlist, can this be useful?

The code isnā€™t very clean and not super nice, but it obviously works (well for now).

If you want to do some tests on one of your tables, here is the link for YC:
https://Search-V2.manun2.repl.co

Here is a demonstration, 1 Text tab & 1 tab with an inline-list
Looking forward to your comments.


5 Likes

Iā€™m thinking the use of ā€œā€ would eliminate the need for a separate and/or indicator, which you already did. It would also make the words contained within the double quotes obligatory and exact.

For example, in google you can search for:
this becomes that
This would return results that contain this or becomes or that. Obviously with more advanced ranking that places priority on those results that contain the exact phrase or all of the words, but I donā€™t think we are worrying about that here.

If you search for:
ā€œthisā€ becomes that
Then it would return results that must contain this. As I type this and think about it more, Iā€™m not sure if the inclusion of becomes or that should give results that contain this AND (becomes OR that) or if it should treat it like (this OR becomes OR that). It looks like you have it set up the second way, so all results must contain this to be true and the rest of the words are essentially ignored since it found a match for this.

If you search for:
ā€œthis becomesā€ that
Then it would return results that must contain this becomes as a phrase, but as I indicated above, your code kind of ignores that since any results must contain this becomes. Should it really be (this becomes AND that) or just ignore that like it is now, since it found a match for this becomes?

If you search for:
ā€œthis becomes thatā€
Then the entire phrase must find a match.

I would be curious what other peopleā€™s opinions are on combining words or phrases in double quotes with words that are not in double quotes. Should at least one of the words that do not have double quotes be included in the search results, or not? I realize that adds a whole new level of complexity, but Iā€™m not sure what the correct answer is. I think what you have right now looks really good though and works how I had expected it to work.

2 Likes

I passed the challenge then! :grinning: :stuck_out_tongue_winking_eye: :rofl: :rofl:

1 Like

@Manu.n I have tried your text search and it looks GREAT! At least from my way of testing itā€¦
It is really intuitive and I could not fault it. I like the use of ā€œā€ to search for exact correspondence of that letter sequence (right?). A couple of questions:

  1. I have noticed that your other tab (search inline list V2) only search within the titles of the elements, not on the whole row of data (e.g. email address). Is this correct? Could the text search be performed on all the row elements (i.e. across all the columns)? I imagine that having a last ā€œtemplateā€ cell joining together all the previous cell contents would do the trickā€¦
  2. Are the ā€œsearch textā€ field and other needed columns user specific? In other words, can different users make different searches and obtain different inline list results?
1 Like

Hello @POWH_RPS
None of your questions can fit into the Experimentale column, but you can do so with:

  1. to do a search on several columns, you must before doing a template column group together the data to be searched

  2. For the search to be specific to the user, you must do a ā€œsearchā€ column with the option ā€œuser-specificā€

I am preparing a final version for today (I think).

VERSION 2 Here

5 Likes