Skip to content

Conversation

@l-trotta
Copy link
Contributor

@l-trotta l-trotta commented Jul 17, 2024

Added in 8.8, include_named_queries_score adds the score to the result of named query.
In practice, it changes the type of matched_queries in Hit from string[] to string[] | Dictionary<string,double>, because the server will return a different data structure depending on the value of include_named_queries_score in the request.

After discussing this, we decided that for now strongly typed clients (java, go, .net) won't support it, but we're still adding this to the spec for completeness and for other clients that might be able to support it.

@Anaethelion, @flobernd before merging this we need to exclude include_named_queries_score from the available query parameters and ignore the secondary type of matched_queries.

@JoshMock does this cause any problem for javascript?

fixes #2405

@github-actions
Copy link
Contributor

Following you can find the validation results for the API you have changed.

API Status Request Response
search 🔴 2127/2205 2139/2187

You can validate this API yourself by using the make validate target.

@github-actions
Copy link
Contributor

Following you can find the validation results for the APIs you have changed.

API Status Request Response
search 🔴 2127/2205 2139/2187

You can validate these APIs yourself by using the make validate target.

@JoshMock
Copy link
Member

Nope, no problems from JS. 👍

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thank you! This looks great. I confirmed that this does not work as part of the request body.

However, this needs to be added to MultiSearchRequest.ts.

@l-trotta
Copy link
Contributor Author

l-trotta commented Aug 2, 2024

@pquentin added it to multisearch, thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2024

Following you can find the validation results for the APIs you have changed.

API Status Request Response
msearch 🟢 17/17 16/16
search 🔴 2135/2213 2147/2195

You can validate these APIs yourself by using the make validate target.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Should we also add the performance caveat from the docs?

Typically, this adds a small overhead to a request. However, using computationally expensive named queries on a large number of hits may add significant overhead.

Also, the server_default false annotation is missing.

(Sorry for missing that earlier.)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2024

Following you can find the validation results for the APIs you have changed.

API Status Request Response
msearch 🟢 17/17 16/16
search 🔴 2135/2213 2147/2195

You can validate these APIs yourself by using the make validate target.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@l-trotta
Copy link
Contributor Author

l-trotta commented Aug 6, 2024

@flobernd @Anaethelion let me know when the generators are ready so that we can merge this

@flobernd
Copy link
Member

flobernd commented Aug 6, 2024

@l-trotta My generator is adjusted.

@Anaethelion
Copy link
Contributor

@l-trotta all good for me.

@l-trotta l-trotta merged commit f2a90e8 into main Aug 6, 2024
@l-trotta l-trotta deleted the adding-include-named-queries-score branch August 6, 2024 15:19
github-actions bot pushed a commit that referenced this pull request Aug 6, 2024
* added include_named_queries_score to search

* correctly mapping matched_queries

* also added to multisearch

* added more description + default

(cherry picked from commit f2a90e8)
l-trotta added a commit that referenced this pull request Aug 6, 2024
* added include_named_queries_score to search

* correctly mapping matched_queries

* also added to multisearch

* added more description + default

(cherry picked from commit f2a90e8)

Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing include_named_queries_score in search and boolean query

6 participants