Elasticsearch Query

Hello :slight_smile:

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 !

cross-fields is probably what you want.

1 Like

That is amazing. Thanks you very much.

This is the query for people who probably need it :wink:

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