Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eval: prefer longer candidateMatch when removing overlaps (#727)
When thinking about transforming queries like 'foo bar' into '(foo bar) or "foo bar"' we would want to keep the phrase candidateMatch and not throw it away in gatherMatches. By sorting longer matches before others that start at the same offset we end up keeping those. Note: this only affects ChunkMatch, since for LineMatch we merge when we find overlaps. Test Plan: This was quite hard to test with our existing e2e tests due to them not recording offsets, only matching lines. So instead I am just relying on the fact we didn't break anything and once we add proper support for phrases we will have a test then.
- Loading branch information