title: Index not updated when upserting document
body: <p>I'm using ElasticSearch 1.4.2 and want to upsert some document in json format to it. When I try to insert a test document I can only find it via id, but not via search of the logName field or others that I tried. Probably I miss a step in the upsert method, it's at the end of the question.</p>
  
  <p>Here the query results:</p>
  
  <pre><code>$ curl -XGET http://localhost:9200/pwotest/_search?q=logName:%22pwotest1%22\&amp;pretty=true
  {
    "took" : 1,
    "timed_out" : false,
    "_shards" : {
      "total" : 5,
      "successful" : 5,
      "failed" : 0
    },
    "hits" : {
      "total" : 0,
      "max_score" : null,
      "hits" : [ ]
    }
  }
  </code></pre>
  
  <p>Searching for the id results in a document where logName is <code>pwotest1</code>:</p>
  
  <pre><code>$ curl -XGET http://localhost:9200/pwotest/_search?q=\$oid:%22549954143004ba1bf99a56ba%22\&amp;pretty=true
  {
    "took": 1,
    "timed_out": false,
    "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
    },
    "hits": {
      "total": 1,
      "max_score": 3.1972246,
      "hits": [
        {
          "_index": "pwotest",
          "_type": "User",
          "_id": "549954143004ba1bf99a56ba",
          "_score": 3.1972246,
          "_source": {
            "_id": {
              "$oid": "549954143004ba1bf99a56ba"
            },
            "logName": "pwotest1",
            "modifiedBy": "test",
            "modifiedId": "549954143004ba1bf99a56ba",
            "modificationDate": 1419334676507,
            "internalType": "create",
            "dm_Version": "0.8.2",
            "creationDate": 1419334676515,
            "createdId": "549954143004ba1bf99a56ba"
          }
        }
      ]
    }
  }
  </code></pre>
  
  <p>The code to upsert the document is in Java and looks like this:</p>
  
  <pre><code>/**
   * See &lt;a href="http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/java-update-api.html"&gt;ES doc&lt;/a&gt;
   * @param o is a representation of PWO object
   * @throws PWOException 
   */
  public void update(JsonObject o) throws PWOException {
      Preconditions.checkNotNull(index, "index must not be null for update");
      getNode();
      Client client = node.client();
      // this needs to come from somewhere
      String type = "User";
      String id = GsonHelper.getId(o).get();
      String json = new Gson().toJson(o);
      IndexRequest indexRequest = new IndexRequest(index, type, id).
              source(json);
      UpdateRequest upd = new UpdateRequest(index, type, id).
              doc(json).
              upsert(indexRequest);
      Logger.info("Update is %s [%s, %s, %s]", upd, index, type, id);
      try {
          client.update(upd).get();
      } catch (InterruptedException | ExecutionException e) {
          throw new PWOException(GsonHelper.createMessageJsonObject("Update in elastic search failed"), e);
      }
  }
  </code></pre>