Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "not contains" query operator #94

Open
mikegoatly opened this issue Dec 18, 2023 · 0 comments
Open

Add a "not contains" query operator #94

mikegoatly opened this issue Dec 18, 2023 · 0 comments

Comments

@mikegoatly
Copy link
Owner

Proposal: Add a NOT operator to the query syntax, possibly something like eiffel !tower which would search for documents containing "eiffel" but not "tower".

Design questions

Should ! only be subtractive from the currently matched query results? For example, in the case of eiffel !tower we would match all documents containing eiffel, then subtract and documents and also contain tower.

This would mean that ! could not be used in isolation. For example, searching for !tower to match all the documents that don't contain tower, wouldn't work because it would logically equate to "no documents, subtracting any containing tower". It could be achieved using an expansive wildcard search followed by a negation, e.g. * !tower, but that's computationally expensive as we have to traverse the entire tree and return the locations of all tokens in all documents.

Originally created from #90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant