Skip to content

Add FunctionScoreQuery fields and k-NN link on gRPC Search page#12422

Open
Nishieee wants to merge 2 commits into
opensearch-project:mainfrom
Nishieee:doc/grpc-search-function-score-knn-link
Open

Add FunctionScoreQuery fields and k-NN link on gRPC Search page#12422
Nishieee wants to merge 2 commits into
opensearch-project:mainfrom
Nishieee:doc/grpc-search-function-score-knn-link

Conversation

@Nishieee
Copy link
Copy Markdown
Contributor

Description

Documents FunctionScoreQuery on the gRPC Search page (_api-reference/grpc-apis/search.md): adds #### FunctionScoreQuery fields under compound queries, with a field table and protobuf links aligned to opensearch-protobufs 1.2.0 (same pattern as BoolQuery / ConstantScoreQuery). Adds a short line under Specialized query fields linking to k-NN (gRPC) so readers can open the dedicated KnnQuery documentation.

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

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

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>
@kolchfa-aws
Copy link
Copy Markdown
Collaborator

@karenyrx Could you review this PR?

@kolchfa-aws kolchfa-aws self-assigned this May 13, 2026
@kolchfa-aws kolchfa-aws added Tech review PR: Tech review in progress backport 3.6 labels May 13, 2026
| `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/).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a link to itself?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done!

Signed-off-by: Nishita Matlani <matlaninishi@gmail.com>
@Nishieee Nishieee requested a review from karenyrx May 15, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 3.6 Tech review PR: Tech review in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC] gRPC Search: FunctionScoreQuery fields + knn cross-link

3 participants