title: Elastic Search multi_match cross_fields prefix
body: <p>I have a <code>multi_match</code> query of type <code>cross_fields</code>, which I want to improve with prefix matching.</p>
  
  <pre><code>{
    "index": "companies",
    "size": 25,
    "from": 0,
    "body": {
      "_source": {
        "include": [
          "name",
          "address"
        ]
      },
      "query": {
        "filtered": {
          "query": {
            "multi_match": {
              "type": "cross_fields",
              "query": "Google",
              "operator": "and",
              "fields": [
                "name",
                "address"
              ]
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>It is matching perfectly on queries such as <code>google mountain view</code>. The <code>filtered</code> array is there because I dynamically need to add geo filters.</p>
  
  <pre><code>{
    "id": 1,
    "name": "Google",
    "address": "Mountain View"
  } 
  </code></pre>
  
  <p>Now I want to allow prefix matching, without breaking <code>cross_fields</code>.</p>
  
  <p>Queries such as these should match:</p>
  
  <ul>
  <li><code>goog</code></li>
  <li><code>google mount</code></li>
  <li><code>google mountain vi</code></li>
  <li><code>mountain view goo</code></li>
  </ul>
  
  <p>If I change the <code>multi_match.type</code> to <code>phrase_prefix</code>, it matches the whole query against a single field, so it matches only against <code>mountain vi</code> but not against <code>google mountain vi</code></p>
  
  <p>How do I solve this?</p>