Disallow explicitly setting search_type with knn search#88504
Disallow explicitly setting search_type with knn search#88504jtibshirani merged 2 commits intoelastic:knn-searchfrom
Conversation
|
Pinging @elastic/es-search (Team:Search) |
|
I initially tried a strategy where we check this inside |
| searchRequest.indicesOptions(IndicesOptions.fromRequest(request, searchRequest.indicesOptions())); | ||
|
|
||
| checkRestTotalHits(request, searchRequest); | ||
| validateSearchRequest(request, searchRequest); |
There was a problem hiding this comment.
If validateSearchRequest already includes checkSearchType why do we need to call it again after validateSearchRequest?
There was a problem hiding this comment.
Thanks @mayya-sharipova , this was just an oversight. Will fix.
mayya-sharipova
left a comment
There was a problem hiding this comment.
@jtibshirani Thanks, this overall LGTM, except the removal of double checking in RestSearchAction. After fixing it, this PR can be merged without further review.
|
Pinging @elastic/clients-team (Team:Clients) |
When kNN search is enabled, it automatically uses the
dfs_query_then_fetchsearch type. The user can no longer control the search type that's used. This
commit throws an error if
search_typeis explicitly set whenknnsearch isused.
Addresses #87625.