title: Elasticsearch Java API - building queries
body: <p>I have looked through the docs for the <a href="http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/search.html" rel="noreferrer">Search API</a> but find them not descriptive enough (even though they are very well written). I am trying to build a query but understand little about all the different options available and cannot find information on the matter, when building a query and I am unable to translate queries I can run in Sense to queries I can run using the <a href="http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/index.html" rel="noreferrer">Java API</a>.</p>
  
  <p>In Sense I have the following: </p>
  
  <pre><code>GET index/_search
  {
    "query": {
      "match" : {
        "name" : "some string"
      }
    }
  }
  </code></pre>
  
  <p>And in my Java code I have:</p>
  
  <pre><code>node = nodeBuilder().client(true).clusterName(CLUSTER_NAME).node();
  client = node.client();
  QueryBuilder qb = QueryBuilders.termQuery("name", "some string");
  SearchResponse response = client.prepareSearch("index") //
      .setQuery(qb) // Query
      .execute().actionGet();
  </code></pre>
  
  <p>But they produce different search results. What is the difference as I cannot see it? Also is there a good source of information that might be of use?</p>