elastic / elasticsearch-specification

Elasticsearch full specification
Apache License 2.0
110 stars 66 forks source link

Add specification for new sparse vector query; deprecate specification for text_expansion and weighted_tokens queries #2642

Closed kderusso closed 1 week ago

kderusso commented 1 week ago

Adds specification for the new sparse_vector query and deprecates the specifications for text_expansion and weighted_tokens queries.

l-trotta commented 1 week ago

if I got this right every sparse query should have either query_vector or inference_id, the way we model this to have it checked client side is to add /** @variants container */ on top of the class and mark all properties that can always be added with @variant container_property, an example of this is PinnedQuery where you must set either ids or docs

kderusso commented 1 week ago

if I got this right every sparse query should have either query_vector or inference_id, the way we model this to have it checked client side is to add /* @variants container / on top of the class and mark all properties that can always be added with @variant container_property, an example of this is PinnedQuery where you must set either ids or docs

Thanks @l-trotta! I think I got this right?

l-trotta commented 1 week ago

almost! all properties that aren't query_vector or inference_id should be @variant container_property, so not just field. basically this is to assure that either query_vector or inference_id are set, but not both of them, while all the other properties are unaffected by this check.