title: is there a priority filter in elasticsearch?
body: <p>I want to know if there is filter which would filter by certain no of field probably 4,if all 4 does not match then filter by next three fields(if all 3 fields does not match then match by other 2 fields.)</p>
  
  <p>In the end I want docs that matches 4 fields, if all 4 fields does not match then docs matching 3 fields.</p>
  
  <p>By the query I run, I am able to get all the documents whenever there is a field match.</p>
  
  <p>My doc structure is as below   </p>
  
  <pre><code>{
    colors: [
      'blue'
    ],
    brands: 'nike',
    size: [
      'xl'
    ],
    features: [
      'sports'
    ]
  },
  {
    colors: [
      'red'
    ],
    brands: 'adidas',
    size: [
      'xxl'
    ],
    features: [
      'sports'
    ]
  },
  {
    colors: [
      'green'
    ],
    brands: 'adidas',
    size: [
      'xx'
    ],
    features: [
      'sports'
    ]
  }
  </code></pre>
  
  <p>So if I run for search term <strong>"blue xl sports"</strong> it should return the first document only which has all the three matches. Now if there is xl sports it should return first and the third document without the second document.</p>
  
  <p>So the documents should be highest matched fields rather than all the fields.</p>