Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for completion suggests #146

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

andypearson
Copy link
Contributor

When using a completion suggester via the search endpoint three additional fields are returned in each option; id, index and source.

Update the Snap.Suggest.Option struct so that these fields are represented making sure that score is supported with an underscored and non-underscored key.

Docs: https://opensearch.org/docs/latest/search-plugins/searching-data/autocomplete/#completion-suggester

* Match on the `Snap.Suggest` and `Snap.Suggest.Option` structs
* Match additional `freq` and `score` fields
* Assert that `score` is a float
When using a completion suggester via the `search` endpoint three
additional fields are returned in each option; `id`, `index` and
`source`.

Update the `Snap.Suggest.Option` struct so that these fields are
represented making sure that `score` is supported with an underscored
and non-underscored key.

Docs:
https://opensearch.org/docs/latest/search-plugins/searching-data/autocomplete/#completion-suggester
@andypearson andypearson requested a review from tomtaylor March 5, 2025 12:20
@andypearson andypearson merged commit efcc614 into main Mar 5, 2025
6 checks passed
@andypearson andypearson deleted the add-support-for-completion-suggests branch March 5, 2025 17:33
@tomtaylor
Copy link
Collaborator

Released in 0.12.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants