Sometimes we just don’t care about TF/IDF. All we want to know is that a certain
word appears in a field. Perhaps we are searching for a vacation home and we
want to find houses that have as many of these features as possible:

However, this isn’t really full-text search. In this case, TF/IDF just gets
in the way. We don’t care whether wifi is a common term, or how often it
appears in the document. All we care about is that it does appear.
In fact, we just want to rank houses by the number of features they have—the more, the better. If a feature is present, it should score 1, and if it
isn’t, 0.

Really, though, each of these features should be treated like a filter. A
vacation home either has the feature or it doesn’t—a filter seems like it
would be a natural fit. On top of that, if we use filters, we can
benefit from filter caching.

The problem is this: filters don’t score. What we need is a way of bridging
the gap between filters and queries. The function_score query does this
and a whole lot more.