Open klonos opened 5 years ago
I like the idea!
To consider: I vaguely remember that doing a "contains" search in autocomplete inputs might have performance issues. Can a technical expert assess the performance question?
I think this should be configurable. I recently worked on a website with hundreds of nodes, and when using an autocomplete field to find content it was nigh impossible to find anything as it was using 'contains' and displayed way too many results to be helpful (especially since it only shows the first 10 or so matches).
So on small sites I agree that 'contains' is better. But I think those with larger sites or the preference for 'begins with' should still have that option.
Random thoughts on the matter:
If performance is indeed an issue, then I wonder if there is any way to "dynamically" switch from contains
to begins with
after a set amount of time (1sec for example).
Even better if there was a way to start with a begins with
search, populate the dropdown with the results from that, and at the same time keep searching with contains
in the background.
Perhaps sites with larger amount of data/content can use an "Entity Browser" type of widget instead of the autocomplete.
While working on #1777, I noticed that when you start typing "first" in the link dialog in a vanilla Backdrop installation, there is no result returned. When you start typing "your", the "Your first post" content comes up. I think that we should be doing a "contains" search, or even a fuzzy search instead.