[#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:
11
src/model.js
11
src/model.js
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user