Closed
Description
KnnQuery
and KnnSearch
are two different classes in elasticsearch java client and are for different queries:
KnnSearch
: is the top levelknn
query in the elasticsearch request;KnnQuery
: is theknn
query insidequery
clause;
They both have different parameters and different classes in elasticsearch java client. However, in the current spring data elasticsearch implementation, they are mixed together and are all converted into KnnSearch
finally.
So I wanna submit a PR to:
- remove
KnnQuery
inNativeQuery
: and I think this clause should be constructed inside theco.elastic.clients.elasticsearch._types.query_dsl.Query
inNativeQuery
by user manually; - add
withKnnSearches
method inNativeQueryBuilder
: this may be a loss without whichKnnSearch
can't be constructed by user; - add knn search mapping parameters in elasticsearch 8;
If there are questions about the issues above, we can discuss further.