anchor.diff:          .startObject()
               .field("query", qb) // Register the query
           .endObject())
  -    .setRefresh(true) // Needed when the query shall be available immediately
  +    .setRefreshPolicy(RefreshPolicy.IMMEDIATE) // Needed when the query shall be available immediately
       .get();
   --------------------------------------------------
   
  
positive.code: // create an index with a percolator field with the name 'query':
  client.admin().indices().prepareCreate("myIndexName")
                          .addMapping("query", "query", "type=percolator")
                          .get();
  
  //This is the query we're registering in the percolator
  
negative.code: --------------------------------------------------
  //Build a document to check against the percolator
  XContentBuilder docBuilder = XContentFactory.jsonBuilder().startObject();
  docBuilder.field("content", "This is amazing!");
  docBuilder.endObject(); //End of the JSON root object
  
  PercolateQueryBuilder percolateQuery = new PercolateQueryBuilder("query", "docs", docBuilder.bytes());
  
  // Percolate, by executing the percolator query in the query dsl:
  SearchResponse response = client().prepareSearch("myIndexName")
          .setQuery(percolateQuery))
          .get();
  //Iterate over the results
  for(SearchHit hit : response.getHits()) {
  