Hi,
I am running percolate action and it's works greate but.. when I am trying to add aggregation to percolate request but its returns with no matches.
like:
PercolateResponse response = client.preparePercolate()
.setIndices("myIndexName")
.setDocumentType("myDocumentType")
.setSource(docBuilder).addAggregation(AggregationBuilders.terms("ruleNames").field("ruleName")).execute().actionGet();
My percolator mapping is:
PUT news-feed-index/.percolator/_mapping
{
".percolator" : {
"properties" : {
"query" : {
"type" : "object",
"enabled" : false
},
"usersRuleState" : {
"type": "nested",
"properties": {
"user": {"type": "string"},
"isActive": {"type": "boolean"}
}
},
"filter": {"type": "string"},
"owner": {"type": "string"},
"ruleName": {"type": "string"}
}
}
}
and I am trying to do this but in Java Api:
POST /news-feed-index/news/_percolate/
{
"doc": {
"subject": "Murder in Mexico",
"body": "",
"priority":1
},
"size": 0,
"aggs" : {
"users" : {
"terms" : {
"field" : "user"
}
}
}
}
Any help?