title: Elasticsearch - if no match use next query
body: <p>I've been looking for some days in the internet, but find no correct answer to my question. Maybe anyone can help?</p>
  
  <p>If my query in elasticsearch have no hits they have to search in other fields. If there is an result, then show only these without searching in the other fields. My current solution is to boost the fields (ean,model,imodel), but the search in the other fields (title,desc) go on. So it returns hundreds of not relevant items.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
     "from": 0,
     "size": "16",
     "query": {
        "bool": {
           "should": [
              {
                 "multi_match": {
                    "query": "63090300",
                    "fields": [
                       "ean^100",
                       "model^100",
                       "imodel^100"
                    ]
                 }
              },
              {
                 "match": {
                    "title_de": {
                       "query": "63090300",
                       "boost": "5"
                    }
                 }
              },
              {
                 "match": {
                    "title_de": {
                       "query": "63090300",
                       "type": "phrase",
                       "analyzer": "trigrams",
                       "fuzziness": "1"
                    }
                 }
              },
              {
                 "multi_match": {
                    "query": "63090300",
                    "fields": [
                       "desc_de"
                    ],
                    "operator": "and"
                 }
              }
           ]
        }
     }
  }</code></pre>
  </div>
  </div>
  </p>