Add FunctionScoreQuery fields and k-NN link on gRPC Search page#12422
Add FunctionScoreQuery fields and k-NN link on gRPC Search page#12422Nishieee wants to merge 2 commits into
Conversation
Document FunctionScoreQuery from opensearch-protobufs 1.2.0 alongside other compound queries. Point knn readers to the dedicated k-NN (gRPC) doc. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Nishita Matlani <matlaninishi@gmail.com>
|
@karenyrx Could you review this PR? |
| | `boost` | `optional float` | A floating-point number used to decrease or increase the relevance scores of the query. Default is `1.0`. | | ||
| | `x_name` | `optional string` | A query name for query tagging. | | ||
|
|
||
| See also [Function score query]({{site.url}}{{site.baseurl}}/query-dsl/compound/function-score/). |
There was a problem hiding this comment.
Is this a link to itself?
There was a problem hiding this comment.
Oh I see, it's a link to the HTTP function score APIs https://docs.opensearch.org/latest/query-dsl/compound/function-score/
I don't know if we want to add it here, since the other query types do not have corresponding links, but I don't have a strong preference
Perhaps we can also just link to the HTTP APIs homepage as a whole https://docs.opensearch.org/latest/query-dsl/ at the top of this page too
There was a problem hiding this comment.
I added the function-score link because gRPC mirrors the HTTP DSL and that page is the clearest spec for those parameters; I’m happy to drop it for consistency, add a single top-level Query DSL link instead, or extend the same pattern to the other query types.
|
|
||
| The [`FunctionScoreQuery`](https://github.com/opensearch-project/opensearch-protobufs/blob/1.2.0/protos/schemas/common.proto#L2154) message accepts the following fields. | ||
|
|
||
| | Field | Protobuf type | Description | |
There was a problem hiding this comment.
nit: to follow the convention of other query types, would be good to reorder the table to follow the same ordering as the protobuf fields - e.g. boost, x_name, etc
Signed-off-by: Nishita Matlani <matlaninishi@gmail.com>
Description
Documents FunctionScoreQuery on the gRPC Search page (
_api-reference/grpc-apis/search.md): adds#### FunctionScoreQuery fieldsunder compound queries, with a field table and protobuf links aligned to opensearch-protobufs 1.2.0 (same pattern asBoolQuery/ConstantScoreQuery). Adds a short line under Specialized query fields linking to k-NN (gRPC) so readers can open the dedicatedKnnQuerydocumentation.Issues Resolved
Closes #12421
Version
OpenSearch 3.x (gRPC Search API; protobuf references 1.2.0 as used elsewhere on the page).
Frontend features
N/A
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.