Replies: 1 comment 5 replies
-
Correct. This is the default behavior of Lunr.js, the search engine we use for implementation. The We are also actively working on a new version of the search which will not exhibit this behavior! The next iteration will not be based on Lunr.js anymore and be much more tailored to documentation search. Here's a sneak peak. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Search uses a logical OR on the terms of the query, and I've found that adding additional words INCREASES the number of matching documents rather than filtering it further.
I tried to fix this by implementing logical AND functionality, as described below. That said, I'm open to advice on other ways to solve the problem. For example, is there a way to configure the search results to sort documents so that those with all terms matching are listed first?
In pursuit of modifying all queries to logical AND, I had the notion of transforming search strings to requre each word ("+search +string"), but when it wasn't working, I simplified thing down to some test code to simply verify that I can modify the query:
This has no effect. Would be happy for advice on how to make this work, or on how to address the problem in a different way.
Beta Was this translation helpful? Give feedback.
All reactions