I index a document like that:
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("name_surname", "Cristiano Ronaldo");
jsonObject1.accumulate("teams", "Sporting Lizbon");
jsonObject1.accumulate("teams", "Manchester United");
jsonObject1.accumulate("teams", "Real Madrid");
jsonObject1.put("2014 rank", 1);
client.prepareIndex("company", "employee", "1").setSource(jsonObject1.toString()).execute().actionGet();
I can search it and get hit with below query:
QueryBuilder qb=QueryBuilders.matchQuery("2014 rank", 1);
SearchResponse searchResponse=client.prepareSearch().setQuery(qb).execute().actionGet();
But wildCardQuery doesn't seem to work:
QueryBuilder qb = QueryBuilders.wildcardQuery("name_surname","*naldo");
I think there is a problem with analyzers when I index it. Is whitespace the problem and if it is how can i fix it?