Add negative constraint parsing to lexical search#2428
Open
Mbeaulne wants to merge 1 commit into
Open
Conversation
🎩 PreviewA preview build has been created at: |
This was referenced Jun 18, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8 tasks
This was referenced Jun 18, 2026
Mbeaulne
commented
Jun 18, 2026
Mbeaulne
commented
Jun 18, 2026
Mbeaulne
commented
Jun 18, 2026
Mbeaulne
commented
Jun 18, 2026
Mbeaulne
commented
Jun 18, 2026
97e37c0 to
4f20ff2
Compare
0a7d588 to
e379e64
Compare
4f20ff2 to
638c7b7
Compare
e379e64 to
89029f0
Compare
638c7b7 to
3f91762
Compare
89029f0 to
fc80727
Compare
3f91762 to
790c426
Compare
790c426 to
554c927
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds support for negative constraints in lexical search queries. When a user includes phrases like "not GCS", "excluding GCS", or "without GCS" in their search, components matching those excluded terms are filtered out of the results. This allows users to express intent more naturally, such as "I want to upload a file but not to GCS", and receive only the relevant components.
This is implemented by parsing the query text before tokenization, extracting negative constraint phrases using a regex pattern, and scoring any index entry that matches a negative token as zero. The word
"but"has also been added to the stop words list to avoid it interfering with scoring.Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
"upload a file but not to GCS"or"upload a file excluding GCS".Additional Comments
The negative constraint pattern currently recognises the trigger words
without,excluding,exclude,not, andno, optionally followed by prepositions liketo,use, orusing.