# Elasticsearch Query

**URL:** <https://discuss.elastic.co/t/elasticsearch-query/50868>\
**Category:** Elasticsearch\
**Created:** [May 24, 2016, 4:11pm UTC](https://discuss.elastic.co/t/elasticsearch-query/50868 "2016-05-24T16:11:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehdif](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mehdif](https://discuss.elastic.co/u/mehdif)\
**Post date:** [May 24, 2016, 4:11pm UTC](https://discuss.elastic.co/t/elasticsearch-query/50868/1 "2016-05-24T16:11:25Z")

</div>

Hello 🙂

I have configured an Elasticsearch index with two fields : "Name" and "Type".  
When I execute the query below, I don't get any result because "actor" is in the "Type" field.

```
{
  "query": {
    "multi_match": {
      "query": "johnny depp actor",
      "operator": "AND",
      "fields": [
        "name",
        "type"
      ],
      "tieBreaker": 0.7
    }
  }
}

```

Is there any way to execute a query with a number of words, and to get results even if some words are in the "Name" field and others in the "Type" field.

Thanks for you help !

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [May 24, 2016, 4:26pm UTC](https://discuss.elastic.co/t/elasticsearch-query/50868/2 "2016-05-24T16:26:48Z")

</div>

[cross-fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#type-cross-fields) is probably what you want.

---

<div class="post-metadata">

**Author:** ![mehdif](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mehdif](https://discuss.elastic.co/u/mehdif)\
**Post date:** [May 24, 2016, 4:37pm UTC](https://discuss.elastic.co/t/elasticsearch-query/50868/3 "2016-05-24T16:37:37Z")

</div>

That is amazing. Thanks you very much.

This is the query for people who probably need it 😉

```
{
  "query": {
    "multi_match": {
      "query": "johnny depp actor",
      "type": "cross_fields",
      "operator": "AND",
      "fields": [
        "name",
        "type"
      ],
      "tieBreaker": 0.7
    }
  }
}
```

---

<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 5, 2017, 10:49pm UTC](https://discuss.elastic.co/t/elasticsearch-query/50868/4 "2017-07-05T22:49:11Z")

</div>


