I have looked through the docs for the Search API 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 Java API.
In Sense I have the following:
GET index/_search
{
"query": {
"match" : {
"name" : "some string"
}
}
}
And in my Java code I have:
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();
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?