🔎 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.

2 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