concept best_field in category elasticsearch

This is an excerpt from Manning's book Relevant Search: With applications for Solr and Elasticsearch.
best_fields —By default, take the highest-scoring field. If the tie_breaker parameter is specified (a value ranging from 0 to 1), the score of remaining fields is incorporated into the overall score. If title has the highest score, this math would look as follows:
Figure 5.6. Contrasting best_fields and most_fields. Here, the title field wins in best_fields, whereas most_fields takes a summation (coordinating factor not shown).
![]()
Which ranking function might work for Star Trek searches? The two strategies live on opposite poles. The best_fields strategy works well when documents rarely have multiple fields that match the search string. This makes a best field easier to choose. The most_fields approach works the opposite. It works when you expect multiple fields from a document to match the search string.
By picking the highest-scoring field that matches a search, best_fields decides, “This search must have been for that field.” If your signal modeling is sound, and each field score is a signal, then best_fields selects the most appropriate signal as the resulting score. In a sense, best_fields is like a job interview—picking the field with the most credentials for the search terms. It ends up attempting to create a signal for each document that says, “This is a title search, and it’s nothing else!” The best_fields strategy can be referred to as a winner-takes-all search. The winning field score is taken, and all other “runner-ups” get ignored or minimized—interpreted as spurious or lower priority.
Reflecting on our problem, it seems possible that sometimes Star Trek fans will search for specific movies by title or description, yet other times they’ll search for actor or director names. Assuming that the scores for these fields correspond to these signals, you likely want to push the search toward one field score or another and ignore the rest. Could this be a use case for best_fields?
To try out a best_fields query, let’s search for Star Trek actor “Patrick Stewart” and see if it behaves as we’d expect. You’d hope that best_fields might figure out we’re searching for a cast member and choose that field as the best.