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

Using _score as a metric in visualizations #41587

Open
markharwood opened this issue Jul 19, 2019 · 1 comment
Open

Using _score as a metric in visualizations #41587

markharwood opened this issue Jul 19, 2019 · 1 comment
Labels
enhancement New value added to drive a business result Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects

Comments

@markharwood
Copy link
Contributor

markharwood commented Jul 19, 2019

Background to requirement

"Relevance engineer" is an emerging job title and Kibana has the potential to be a useful tool in helping tune relevance. Relevance engineers tweak various query DSL settings and want to review the effects of these changes.
Visualizations like the histogram can be very useful, showing the distribution of result scores produced by a query and the types of things they match :

Appsearch_John_Lewis_Sewing_machine_-_Kibana

In this diagram we can see the strict, high-scoring clauses have produced matches that belong to a small cluster of product categories on the right. We can also see that the fuzzier, low-scoring clauses have produced an enormous number of matches from a huge variety of product departments on the left. Seeing this, the relevance engineer might turn-down the fuzzy dial on the query settings. Although the above diagram shows results of a query broken down by `_score` on the x-axis configuring this visualization involved a horrible hack.

What's wrong with analyzing scores in Kibana today?

  1. The drop-down for choice of numeric field in visualizations like histogram does not offer _score.
  2. Since Kibana 7.x (or thereabouts) it is not possible to configure a scripted-field in the index pattern that returns _score.
  3. The histogram field forces you to select a physical field before it enables the "advanced" settings that allow you to enter the JSON to have a script that returns _score BUT - when running the visualization it errors, complaining that an aggregation can't have both the physical field and the scripted data source in the same request. (This happens when the "advanced" JSON is merged with the settings defined in the GUI).

Given all of the above setbacks, the hack that gave me the workaround was:

  • define a scripted-field in the index pattern called bogus that returns "1".
  • select the bogus field in the histogram
  • enter the JSON in the advanced settings to run a script that returns "_score"

It's perhaps a lucky accident that any of this works.

Can we make _score a valid metric for use in visualizations?

@markharwood markharwood added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) enhancement New value added to drive a business result labels Jul 19, 2019
@timroes timroes added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Mar 11, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@stratoula stratoula added Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. and removed Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels May 30, 2023
@kibanamachine kibanamachine added this to Long-term goals in Lens May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
No open projects
Lens
  
Long-term goals
Development

No branches or pull requests

4 participants