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 KNN Operator #1908

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Add KNN Operator #1908

merged 2 commits into from
Nov 21, 2023

Conversation

metonymic-smokey
Copy link
Member

@metonymic-smokey metonymic-smokey commented Nov 10, 2023

This PR allows a user to specify a KNN Operator to determine if KNN hits are conjuncted/disjuncted with filter query hits.

@metonymic-smokey metonymic-smokey marked this pull request as ready for review November 13, 2023 15:55
search_knn.go Outdated Show resolved Hide resolved
@metonymic-smokey
Copy link
Member Author

metonymic-smokey commented Nov 17, 2023

Screenshot of wrong operator with CB Server:
image

No such issue with blank operator:
image

Tested with a UT:
searchRequest.AddKNNOperator("bs_op")

Result:

aditiahuja@Aditis-MacBook-Pro bleve % sudo go test --run=TestSimilaritySearchQuery --tags=vectors
Password:
2023/11/20 14:21:38 unknown knn operator: bs_op
exit status 1
FAIL    github.com/blevesearch/bleve/v2 1.362s

@metonymic-smokey metonymic-smokey marked this pull request as ready for review November 17, 2023 08:38
Copy link
Member

@abhinavdangeti abhinavdangeti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but add some unit tests please.

@abhinavdangeti
Copy link
Member

Yo, you've clearly not tested your unit test code -

# github.com/blevesearch/bleve/v2 [github.com/blevesearch/bleve/v2.test]
./search_knn_test.go:92:15: undefined: getQueryVec

search_knn_test.go Outdated Show resolved Hide resolved
@abhinavdangeti abhinavdangeti merged commit b5c245b into unstable Nov 21, 2023
0 of 9 checks passed
@abhinavdangeti abhinavdangeti deleted the knn-op branch November 21, 2023 17:34
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

Successfully merging this pull request may close these issues.

3 participants