Hi All,
I am facing two problems in my code:
1.
I am using date histogram facet for implementing time chart. While
applying multi-filter for the facet I am facing error like Failed to
execute.
My Code is working when I am using
searchRequestBuilder.addFacet(FacetBuilders.dateHistogramFacet("1").facetFilter(finalFilter).field("harvesttime").interval("day").facetFilter(queryFilter(termQuery("mediatypeid","1"))));
But if I place this code inside a for loop for changing mediatypeid
value like
String mediatypeArray[i]={1,2,3,4};
for(int i=0; i<mediatypeArray[i];i++)
{
searchRequestBuilder.addFacet(FacetBuilders.dateHistogramFacet("daterange"+mediatypeArray[i]).facetFilter(finalFilter).field("harvesttime").interval("day").facetFilter(queryFilter(termQuery("mediatypeid",mediatypeArray[i]))));
}
The above mediatypeArray contains a set of mediatype ids
And also I cant able to apply filter for this facet.
- I need a time line graph for number of posts for particular date
I need a facet like
"date e.g(1328054400000)" : {
"_type" : "date_histogram",
"entries" : [ {
"term" : 1,
"count" : 4
}]
}
but I am getting like this,
"print" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1328054400000,
"count" : 4
}, {
"time" : 1328140800000,
"count" : 1
}, {
"time" : 1328227200000,
"count" : 1
}, {
"time" : 1328400000000,
"count" : 1
}, {
"time" : 1328486400000,
"count" : 4
}, {
"time" : 1328572800000,
"count" : 3
}, {
"time" : 1328659200000,
"count" : 1
} ]
}
Could you please help in this?.Hope I will resolve my problem soon.
Thanks in advance,
Thanuja