56bc02c4 by Adam Heath

Facets needs to do a direct call to look up suggestions, so make it use

the same sync method as Solr.
1 parent d5e4a434
......@@ -149,12 +149,17 @@ define(function(require) {
return this;
},
initialize: function(data, options) {
var solr = this;
options = (options || {});
this.set('options', this._options = new Backbone.Model({
faceting: !!options.faceting,
highlighting: !!options.highlighting,
showAll: !!options.showAll,
}));
var facets = this.get('facets');
facets.sync = function sync() {
return solr.sync.apply(this, arguments);
};
this._doSearchImmediately = _.bind(function(options) {
this.buildQueryParameters();
this.fetch(_.extend({}, options, {
......@@ -195,7 +200,7 @@ define(function(require) {
this.on('change:currentPage', function(model, value, options) {
this._doSearch(options);
}, this);
this.get('facets').on('item-change', function(model, value, options) {
facets.on('item-change', function(model, value, options) {
this._doSearch(_.extend({}, options, {resetCurrentPage: true}));
}, this);
this.get('ordering').on('change:value', function(model, value, options) {
......