# Multi field match with boosting and fuzziness

**URL:** <https://discuss.elastic.co/t/multi-field-match-with-boosting-and-fuzziness/336806>\
**Category:** Elasticsearch\
**Created:** [June 24, 2023, 8:57am UTC](https://discuss.elastic.co/t/multi-field-match-with-boosting-and-fuzziness/336806 "2023-06-24T08:57:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tim6/32/115988_2.png) [@Tim6](https://discuss.elastic.co/u/Tim6)\
**Post date:** [June 24, 2023, 8:57am UTC](https://discuss.elastic.co/t/multi-field-match-with-boosting-and-fuzziness/336806/1 "2023-06-24T08:57:05Z")

</div>

Hi,

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.

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [June 24, 2023, 11:14am UTC](https://discuss.elastic.co/t/multi-field-match-with-boosting-and-fuzziness/336806/2 "2023-06-24T11:14:57Z")

</div>

@Tim6

Have you tried something with [Query String query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-dsl-query-string-query)?

---

<div class="post-metadata">

**Author:** ![Hemanth\_Gowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hemanth_gowda/32/23886_2.png) [@Hemanth\_Gowda](https://discuss.elastic.co/u/Hemanth_Gowda)\
**Post date:** [June 24, 2023, 2:56pm UTC](https://discuss.elastic.co/t/multi-field-match-with-boosting-and-fuzziness/336806/3 "2023-06-24T14:56:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 22, 2023, 2:56pm UTC](https://discuss.elastic.co/t/multi-field-match-with-boosting-and-fuzziness/336806/4 "2023-07-22T14:56:31Z")

</div>

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