[DOCS] Rewrite dis max query#43586
[DOCS] Rewrite dis max query#43586jrodewig merged 5 commits intoelastic:masterfrom jrodewig:rewrite-dis-max-query
Conversation
|
Pinging @elastic/es-search |
|
Pinging @elastic/es-docs |
There was a problem hiding this comment.
@jrodewig Thanks! This is indeed a nice restructuring. But we lost the use case for this query. Do we plan to put the use case somewhere else in the documentation?
| clauses. | ||
|
|
||
| If a returned document matches multiple query clauses, the `dis_max` query | ||
| assigns the document the highest relevance score from any matching clause. |
There was a problem hiding this comment.
I think it is important to add here "plus a tie breaking increment for any additional matching subqueries".
| If a document matches multiple clauses, the `dis_max` query calculates the | ||
| relevance score for the document as follows: | ||
|
|
||
| . Take the highest relevance score from a matching clause. |
There was a problem hiding this comment.
I think this is a little bit more clear: "take the score from a matching clause with the highest relevance score"
|
|
||
| . Take the highest relevance score from a matching clause. | ||
| . Multiply the score from any other matching clauses by the `tie_breaker` value. | ||
| . Add the highest score to the multiplied scores and normalize. |
There was a problem hiding this comment.
what is normalize here?
|
Thanks for the review @mayya-sharipova! I may have gotten carried away with edits so I re-added some context for the use case and example with 6fa3e0c. |
| factors. If the query is "albino elephant," this ensures that "albino" matching | ||
| one field and "elephant" matching another gets a higher score than "albino" | ||
| matching both fields. | ||
|
|
There was a problem hiding this comment.
@jrodewig Thanks for quickly addressing the feedback.
One small comment, the way information is presented now looks like the query in the example will address what you described before it: " If the query is "albino elephant" this ensures that "albino" matching one field and "elephant" matching another gets a higher score than "albino" matching both fields.". But for this, we need a slightly different query: bool with two should dismax clauses for each field.
May be better, would be to remove this sentence about "albino elephant" all together? WDYT?
There was a problem hiding this comment.
@mayya-sharipova Thanks again for your kind review!
I think you're right about removing the sentence. I also updated the example request to fit the use case without introducing a more complex bool query.
mayya-sharipova
left a comment
There was a problem hiding this comment.
@jrodewig Thanks for your patience on this.
|
@elasticmachine run elasticsearch-ci/oss-distro-docs |
Rewrites the
dis_maxquery to use the new query format.This is part of #40977, an effort to standardize documentation for query types.
Before
Before image
After
After image