[#83,facets][s]: add date histogram facet support.

* Incomplete in various ways (e.g. cannot apply filter correctly using it) but can add and view.
This commit is contained in:
Rufus Pollock
2012-04-10 16:25:08 +01:00
parent 3c9a18ba88
commit dea4b3ece1
3 changed files with 28 additions and 1 deletions

View File

@@ -297,6 +297,17 @@ my.Query = Backbone.Model.extend({
};
this.set({facets: facets}, {silent: true});
this.trigger('facet:add', this);
},
addHistogramFacet: function(fieldId) {
var facets = this.get('facets');
facets[fieldId] = {
date_histogram: {
field: fieldId,
interval: 'day'
}
};
this.set({facets: facets}, {silent: true});
this.trigger('facet:add', this);
}
});