Search: Combine search terms rathen than add them up

Hi there,

I’ve been using Bitwarden on and off, keep coming back to check out the new features and improvements. This time, I almost coulnd’t find anything that would keep me from using and upgrading it…until…

This is about search terms once again. This time about the way they get handled in the seach box.

Example:
I have about 30 Google accounts stored and properly namedin my vault. When I enter “Google” in the search box, I get 30 results. So I naturally add the name of the user to it to narrow down the result.
Other than expected, the results for Google don’t get condensed to show only those that also combine with the user, which would be only one.
No, now I’ve got 40 results; 30 for Google and 10 for the user.

I did read the help page on search but found no way to change this behaviour.
Is it strange to expect this kind of behaviour?

Opinions, please!
Thanks
Olli

I’m adding my vote for this. The search is doing an ‘OR’ for multiple terms, instead of an ‘AND’. For example, when I want to find my “CiT Bank” entry, I type in “CIT”, and get a dozen entries that happen to contain the letters “CIT” in the name. So I enter a space, and then “BANK”, but instead of narrowing the list, it just adds everything with “BANK” in it, making things worse.

It seems to me that an ‘OR’ search for an account is less useful than an ‘AND’ search. If others prefer the ‘OR’ search, then perhaps this can be a preference setting.

1 Like

Agreed. I moved our company to Bitwarden, from LastPass, about a year ago and while it’s a generally much better fit for us, default search relevance is still a major bug bear.

@GeoDosch seems to be right that the default behaviour is using OR when the way that all of my colleagues expect it to behave is AND.

We have many Office 365 accounts and use “o365” in the name of these accounts for easy searching. We also use a 2-5 character client ID, so that if we were to combine the two things xyz o365, we should be presented with just Office 365 results related to that client. However, what we get is a list of ALL Office 365 results combined with ALL the results for that client, essentially xyz o365.

>+xyz +o365 gets the results that my colleagues and I would like 99% of the time when we search for xyz o365. I would love it if this was the default behaviour, or at the very least, there was a tick-box option to enable this as the default search behaviour.

Obviously I don’t want to get rid of the massive power and flexibility of Lunr search, I don’t want to have to type in >+ + all the time, multiple times an hour either.

Thanks :slight_smile:

Oh yeah, while I was primarily talking about the browser extension and desktop app, I would like this across web and mobile as well, since I think it should be consistent.

You could even have an “expand search” button on the search results to show the current behaviour of searching for everything that matches any of the terms typed in.

Has there been any update on this? Seems like a major miss from a UI/UX perspective.

No, still the same. I check back every several months to see if things have improved, but nothing has changed.

It looks like this should be an easy thing to change. See https://github.com/bitwarden/jslib/issues/55.

I don’t know/understand enough of the code to figure it out but I’m still looking. Hoping someone else is willing to lend their eyes too. I think a few lines just need to be changed to make it work. I would test if I had a test environment. :confused:

1 Like

this seems to be a “feature” of lunr.js (https://lunrjs.com/guides/searching.html) search functionality. as described at the bottom of the linked article a logical AND can be simulated by requiring each term to be included.

i just tested this out in the browser and extension search fields and using the correct bitwarden search syntax it works as described.

to logical AND a search (using OP example) “Google” and “username” input “>+Google +username” into the search field and you will get only the results that include both “Google” (not sure about letter-case) and “username” in any field of a vault item. further refinements can be achieved with the “[fieldname]:[value]” syntax.

fortunately, this is a relatively low-cost investment to get more precise results, since you are only adding three characters to the query that you were doing anyway it should not slow you down significantly. and you can replace some portion of the username—after you input the unique part—with and asterisk “*” to shortcut the last part of the username. so instead of “username” you could just put “us*” or whatever is enough to uniquely identify “username” from all the other usernames you have.

Am I the only one that thinks this is still bad UI/UX.

The standard practice is that when you enter two terms to search by, it should find both. In other words, logical AND is the default, generally universally accepted standard.

Shouldn’t BitWarden default to the way things are done pretty much every where else. Imagine if you used the search for this form and it used logical OR instead of logical AND – the results would not be helpful at all.

As you are generally looking for a single item in your vault, not an entire dataset, I would suggest this search feature is more often used to filter results rather than find a set of results.