Hi All,
I am passing the JSON String to wrapperFilter method.
FilterBuilder filterBuilder = FilterBuilders.wrapperFilter("{"filter":
{"and"=[{"term":{"c24":TEXT} }, {"term":{"C25":text} }]} }");
FilteredQueryBuilder qb = QueryBuilders.filteredQuery(queryBuilder,
filterBuilder);
System.out.println("Query : " + qb);
SearchResponse searchResponse = null;
// SortBuilder sort=SortBuilders.fieldSort("c0").order(SortOrder.DESC);
searchResponse = client.prepareSearch("ipdr").addField("c0")
.setQuery(qb).setSize(10000)
.setSearchType(SearchType.QUERY_THEN_FETCH).execute()
.actionGet();
for (SearchHit hit : searchResponse.getHits()) {
try {
System.out.println(hit.getFields().get("c0").getValue()
.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
But, ES will internally fire following query to fetch records:
{
"filtered" : {
"query" : {
"match_all" : { }
},
"filter" : {
"wrapper" : {
"filter" :
"eyJmaWx0ZXIiOiB7ImFuZCI9W3sidGVybSI6eyJjMjQiOlRFWFR9IH0sIHsidGVybSI6eyJDMjUiOnRleHR9IH1dfSB9"
}
}
}
}
Can you guide me to sort out the issue.
Thanks,
Ankit Jain
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.