Search: Combine search terms rathen than add them up

You can suggest an amendment to the documentation if it is not clear to you (there is a link at the bottom of each help page). But to be fair, all the example searches in the Full Text Search documentation start with >. This syntax is also specifically mentioned in a number of places within this thread. You must have missed it or didn’t read the thread.

Regardless, I am glad you figured out how to wield full text searches appropriately. :+1:

Do any of the options listed on the following page have the requisite features?

There may be some suitable alternatives in there, so perhaps someone from the BItwarden team will see this and give them consideration. Thanks for sharing @grb. :+1:

2 Likes

Trunk search function
The search in the vault function searches all fields that contain “one of the words” entered in the search box.
If you enter 3 batches, the function displays each field that contains at least one of the three hits.
There is no multi-word search function for an exact search of the complete occurrence.
Too bad.
I explain :
I have 3 banks
I have 4 accesses per bank
I have 3 Bank Identity Statements per Bank

I type “ACCESS BANK ONE”.
And I have all the hits that contain ACCESS or BANK or ONE, even if I only want hits containing only “ACCESS BANK ONE”.
It’s not always very convenient
Yours sincerely,
Yahtahey

1 Like

Thanks for the request!

We use lunr as our search plugin, and it has some pretty nifty options, some of them are covered in our help article here.

For instance, you can type this into the search to find matches that have all the words: >+ACCESS +BANK +ONE

There are tons of other features as well, definitely give the docs look if you can.

Hi,
@tgreer
I have the same issue as @Yahtahey and tried your suggestion as also explained in the lunr help:

  • adding the > symbol for full lunr search functionality
  • adding the + symbol to create the “and” function

But it does not work for me…, not on the web and not on the desktop Bitwarden application.

does I misunderstood anything?

Many thanks
Kei

I thank you for your feedback and indeed under the format >+ACCESS +BANK +ONE it allows me to display only the contents containing in the title only these 3 occurrences.

So, are BitWarden devs going to consider an option to default to binary AND instead of binary OR since binary AND is far more intuitive and the standard practice for tools like this?

I really want BitWarden to be the best but the UI/UX really does need some work here. It’s still the #1 feedback I get when I try to get folks to switch. The wonky search being the biggest gripe – because of how unintuitive it is.

I totally agree @imthenachoman. The most annoying feedback I get is the OR search thing. Hope there will be a change soon.

Explaining how advanced search works to an employee who doesn’t have much to do with IT is more than frustrating.

Hey @ox4lis @imthenachoman feel free to share examples of searches and search results (dummy data) that you think could be improved, for the team to review.

@bw-admin Thanks for reviewing this issue. One of the weaknesses of Lunr search is that is searches only for words, and is unable to search for exact phrases.

For example, if I want to find vault items that contain a 2-word expression (e.g., “Member ID:”) contained in the notes field, the best I can do is to construct an advanced search expression of the following form:
>+notes:member +notes:id\:

Even this work-around does not guarantee that the two words (“Member” and “ID:”) appear together as a phrase.

On the above topic, I found an interesting post by OliverN on Github, in which he proposes three solutions:

  1. Escape spaces between words (e.g., >+notes:member\ id\:).
  2. Replace spaces by internal wildcards (e.g., >+notes:member*id\:).
  3. Use the lunr.Index#query method instead of the lunr.Index#search method.

Unfortunately, techniques #1 and #2 do not work in Bitwarden’s search interface (they also do not work on the Lunr demo page!). However, it would be great if some developer from Bitwarden or from the community could explore the third technique, using the lunr.Index#query to perform searches on phrases.

I think that the ability to conveniently search for exact would address a significant fraction of use-cases for which AND searching has been requested, although not all.

Thanks for the summary @grb I’ll review with the team :+1:

1 Like

I posted a few times with more examples/details:

I’m no expert in the Bitwarden codebase, so I could be completely wrong, but my best guess is that the query is passed to Lunr in Line #154 of search.service.ts (clients/libs/common/src/services/search.service.ts):

searchResults = index.search(query.substr(1).trim());

Yeah. I was able to find in the code where I think the changes need to be made.

I think Bitwarden should really consider implementing more user friendly search options. The current requirement for complex syntax is fine for tech nerds like me (well, not really, it wastes a lot of my time), but for regular folks, simply punching in the key words and having an AND search applied should be the default search solution.

No reason you can’t have the option to set search to OR or ADVANCED for the techy people.

2 Likes

Hey @LordPhantom welcome to the forums and thanks for the feedback :+1:

Exactly. It should be trivial to add a default behavior to prefix the entered search terms (whatever is entered) with a “>” and prefix each term with a “+” to effectively convert the default entered term into a somewhat equivalent Lunr-syntax search term that yields the overwhelmingly expected “AND” results.

There is no reason to burden every single BitWarden user with forcing non-obvious and not universally well known Lunr search syntax down their throats as a mandatory learning curve and time-waster. Every. Single. Search.

Inexcusable UI/UX decision-making there. Especially when it is a simple fix to hide that complexity, learning curve, and data entry burden behind some JS syntactic sugar added behind the scenes making it completely transparent to the users.

Add a button off to the side called “Advanced Lunr Search” or some such cue (along with a ?/Help direct link to the syntax docs or a cheat sheet for quick help/refresher) for those users that really do want to access the raw Lunr search syntax and have the luxury of time to do that.

Don’t be UI/UX elitist jerks just because you can. It certainly isn’t saving any of your commercial customers any money (employee time costs are real and add up to real money in large organizations). I can guarantee you that none of your commercial customers are interested in paying their employees and contractors to learn and figure out how to use Lunr search syntax in order perform basic login tasks over and over, multiple times a day. Much less offer training in how to use Lunr search syntax just for basic use of the password manager.

That alone is a significant selling point of your competitors!

3 Likes

Hey @mike808 thanks for the feedback, rest assured it has been passed along to the team.

Oh yes, please! This has been bugging me for so long. Good to hear that you consider it, thank you!