-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.4.6
-
Component/s: Text Search
-
Query Integration
-
ALL
-
As currently specified, the logic for phrase matching implicitly ignores any additional terms in the $search string.
For example, the $search string:
"\"ssl certificate\" authority key"
Shall be compiled to the following search:
"ssl certificate" and ("authority" or "key" or "ssl" or "certificate" )
As you can see in the compiled search, all terms besides the phrase "ssl certificate" will be ignored. The search will match all strings that contain the phrase, and none other. In particular, strings that contain any of these additional terms - "authority", "key", or both - will not match unless they also contain the phrase.
There are two problems with this behavior:
- It is surprising, counter-intuitive, and inconsistent with the behavior of regular text searches that do not contain phrases. As a user, I would not expect additional search terms to simply be ignored, certainly in this implicit manner, without any warnings. This is especially surprising given how normal matching works by creating an "OR" relation between the various terms.
- It is less powerful than it could be. Specifying additional terms should allow the user to make meaningful refinements to their search.
Therefore, I propose that the $search strings with a phrase will perform a logical "OR" between the phrase and any of the other phrases or terms in the string.
So, for example, the string above will compile to:
"ssl certificate" OR "authority" OR "key"
This behavior is consistent with the behavior of regular text searches (that do not contain phrases), and provides additional functionality when the user adds additional terms, instead of implicitly ignoring them as is done currently.
Finally, this behavior conforms to parts of the manual that are currently wrong; see for example DOCS-10382.
- related to
-
SERVER-22583 Allow text search to OR exact phrases
- Backlog