title: How to run a combination of query and filter in elasticsearch?
body: <p>I am experimenting using elasticsearch in a dummy project in django. I am attempting to make a search page using <a href="https://github.com/sabricot/django-elasticsearch-dsl" rel="nofollow noreferrer">django-elasticsearch-dsl</a>. The user may provide a <code>title</code>, <code>summary</code> and a <code>score</code> to search for. The search should match all the information given by the user, but if the user does not provide any info about something, this should be skipped.  </p>
  
  <p>I am running the following code to search for all the values.</p>
  
  <pre><code>client = Elasticsearch()
  
  s = Search().using(client).query("match", title=title_value)\
      .query("match", summary=summary_value)\
      .filter('range', score={'gt': scorefrom_value, 'lte': scoreto_value})
  </code></pre>
  
  <p>When I have a value for all the fields then the search works correctly, but if for example I do not provide a value for the <code>summary_value</code>, although I am expecting the search to continue searching for the rest of the values, the result is that it comes up with nothing as a result.</p>
  
  <p>Is there some value that the fields should have by default in case the user does not provide a value? Or how should I approach this?</p>
  
  <hr>
  
  <p>UPDATE 1
  I tried using the following, but it returns every time no matter the input i am giving the same results.</p>
  
  <pre><code>s = Search(using=client)
  
  if title:
      s.query("match", title=title)
  
  if summary:
      s.query("match", summary=summary)
  
  
  response = s.execute()
  </code></pre>
  
  <hr>
  
  <p>UPDATE 2
  I can print using the <code>to_dict()</code>.<br>
  if it is like the following then <code>s</code> is empty</p>
  
  <pre><code>s = Search(using=client)
  s.query("match", title=title)
  </code></pre>
  
  <p>if it is like this</p>
  
  <pre><code>s = Search(using=client).query("match", title=title)
  </code></pre>
  
  <p>then it works properly but still if i add <code>s.query("match", summary=summary)</code> it does nothing.</p>