Multi field match with boosting and fuzziness


Say I have a database of car models containing brand and model

Brand Model
Foo Bar
Foo Baz

So if I search for a Foo Bar I want only the first document to match. If I search for just Foo both documents above must be returned. Each field must be fuzzy and boosted.

  • The multi_match best_fields query will not work because with AND operator it will all terms must be present int a single field. With OR operator it will return document even if only single field matches when two are requested.
  • Copying fields into an "all" field will not work because individual fields cannot be boosted
  • The multi_match cross_fields query will not work because neither fuzziness, nor boosting are supported.
  • combined_fields does not support fuzziness

So what are my options?

Thanks in advance.


Have you tried something with Query String query?

You can use copyto in mapping to copy both brand and model to a new field and use the new field in your match query with and operator. However with fuzziness bar might also match baz since the fuzziness corrects bar to baz.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.