search: robust keyword scanning
Created by: rvantonder
This PR:
- fixes a bug where we don't always ensure spaces before/after a keyword that requires it (currently
and
andor
)
I'm introducing a helper function to do lookahead and lookbehind for keywords. The lookbehind is avoidable, but a more involved change, so I will address this later (filed in #9812).
- the fix also makes keyword scanning more robust, so that queries like
or or or
also works - fixes a bug where parsing would fail if the query only contained whitespace
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #9811 into master will increase coverage by
0.01%
. The diff coverage is100.00%
.@@ Coverage Diff @@ ## master #9811 +/- ## ========================================== + Coverage 42.06% 42.07% +0.01% ========================================== Files 1340 1340 Lines 73727 73739 +12 Branches 6629 6629 ========================================== + Hits 31013 31026 +13 + Misses 39874 39872 -2 - Partials 2840 2841 +1
Flag Coverage Δ #unit 42.07% <100.00%> (+0.01%)
Impacted Files Coverage Δ internal/search/query/parser.go 94.83% <100.00%> (+0.37%)
Please register or sign in to reply