title: foselasticabundle nested queries
body: <p>Im using FOSElasticaBundle to integrate my symfony3 project with elasticsearch. I have a mapping similar to:</p>
  
  <pre><code>company:
      mappings:
          id: { boost: 1, type: string, index: not_analyzed }
          cik: { boost: 2, type: string, index: not_analyzed }
          conformedName: { boost: 6, analyzer: custom_analyzer }
          assignedSIC:
              type: object
              properties:
                  id: { type: string, index: not_analyzed }
                  code: { type: string, index: not_analyzed }
                  title: { analyzer: custom_analyzer }
          businessAddress:
              type: object
              properties:
                  street1: { analyzer: custom_analyzer }
                  street2: { analyzer: custom_analyzer }
                  city: { analyzer: custom_analyzer }
                  state: { analyzer: custom_analyzer }
                  zip: { type: string, index: not_analyzed }
                  phone: { type: string, index: not_analyzed }
  </code></pre>
  
  <p>I want to filter by city, state and zip of the nested businessAddress property.</p>
  
  <p>I have this query:</p>
  
  <pre><code>$boolQuery = new BoolQuery();
  $cityQuery = new Match();
  $cityQuery-&gt;setFieldQuery('businessAddress.city', array($city]));
  $cityQuery-&gt;setFieldParam('businessAddress.city', 'analyzer', 'custom_analyzer');
  $boolQuery-&gt;addMust($cityQuery);
  $this-&gt;finder-&gt;find($boolQuery);
  </code></pre>
  
  <p>json query as</p>
  
  <pre><code>{"query":{"bool":{"must":[{"match":{"businessAddress.city":{‌​"query":["NY"],"anal‌​yzer":"custom_analyz‌​er"}}}]}}}
  </code></pre>
  
  <p>But have 0 results, i dont know if the sintax businessAddress.city will be handled automatically by the bundle or do i need to create a nested query. In case that is a nested query how i can build that?</p>
  
  <h1>EDIT</h1>
  
  <p>After some comments below i notice i was setting match term as array, now i change from:</p>
  
  <pre><code>$cityQuery-&gt;setFieldQuery('businessAddress.city', array($city]));
  </code></pre>
  
  <p>to</p>
  
  <pre><code>$cityQuery-&gt;setFieldQuery('businessAddress.city', $city]);
  </code></pre>
  
  <p>resulting on json query:</p>
  
  <pre><code>{"query":{"bool":{"must":[{"match":{"businessAddress.state":{"query":"NY","analyzer":"custom_analyzer"}}}]}}}
  </code></pre>
  
  <p>i have check over internet and found nothing.</p>
  
  <p>Please help. Thanks</p>