Skip to content

adds matched_queries field for the Hit object#153

Merged
jillesvangurp merged 2 commits intojillesvangurp:masterfrom
AnyRoad:add_matched_queries
Nov 26, 2024
Merged

adds matched_queries field for the Hit object#153
jillesvangurp merged 2 commits intojillesvangurp:masterfrom
AnyRoad:add_matched_queries

Conversation

@AnyRoad
Copy link
Contributor

@AnyRoad AnyRoad commented Nov 25, 2024

Each query accepts a _name in its top level definition.
You can use named queries to track which queries matched
returned documents. If named queries are used, the response
includes a matched_queries property for each hit.

There are two forms of the matched_queries response:

  • if include_named_queries_score was set, response includes map with named query and score
  • otherwise just list of the named queries. so new field is just a JsonElement with 2 extension functions for each case.

 Each query accepts a _name in its top level definition.
 You can use named queries to track which queries matched
 returned documents. If named queries are used, the response
 includes a matched_queries property for each hit.

 There are two forms of the matched_queries response:
  - if include_named_queries_score was set, response includes
    map with named query and score
  - otherwise just list of the named queries.
 so new field is just a JsonElement with 2 extension functions
 for each case.
@jillesvangurp
Copy link
Owner

Thanks for this. The build failed because of some issue with libcurl on gh actions. Can you merge master? That should fix it.

@jillesvangurp jillesvangurp merged commit 1cc78aa into jillesvangurp:master Nov 26, 2024
@AnyRoad
Copy link
Contributor Author

AnyRoad commented Nov 26, 2024

Thank you! Sorry, did not have time to merge it in the morning 😃

@jillesvangurp
Copy link
Owner

No worries; merged myself. It turns out this only works with newer versions of opensearch and elasticsearch. So had to fix the test for that as well.

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