The [similarity] CTE does not filter its query which is filling up the TOP results with data that gets dropped in the query that follows it. This is pushing out usable results in favor of more similar matches that are then filtered out and this is causing INFO NOT FOUND in cases where we know it should not. Duplicating the filter in the CTE seems to resolve this.
What kind of change does this PR introduce?
[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
Description
What's new?
The [similarity] CTE does not filter its query which is filling up the TOP results with data that gets dropped in the query that follows it. This is pushing out usable results in favor of more similar matches that are then filtered out and this is causing INFO NOT FOUND in cases where we know it should not. Duplicating the filter in the CTE seems to resolve this.
What kind of change does this PR introduce?