client.admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("number_of_shards", 1)).execute().actionGet();
client.prepareIndex("test", "type1", "1").setSource("field1", "value1_1", "field2", "value2_1").setRefresh(true).execute().actionGet();
WrapperQueryBuilder wrapper = new WrapperQueryBuilder("{ \"term\" : { \"field1\" : \"value1_1\" } }");
SearchResponse searchResponse = client.prepareSearch().setQuery(wrapper).execute().actionGet();
assertThat(searchResponse.hits().totalHits(), equalTo(1l));
BoolQueryBuilder bool = new BoolQueryBuilder();
bool.must(wrapper);