Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleExample
getCollection: function () {
	return Factories.Collections.Facets.create(this.options.search, this.options.project, {
		facet_fields: [ 'custom_facet' ], // custom facets to fetch
		nof_facets: 100, // maximum number of facet values returned
		itemsCollection: Factories.Collections.Items.create(this.options.search, this.options.project), // associate (optionally) a custom Items collection
	});
},

Once the collection has been fetched, the aggregation results are accessed as collection.indexed.custom_facet with custom_facet being the name of the requested aggregation in the request.

MockItems

Creates a Squirro Items collection. It is possible to throw a JSON object with mocked items at it, to be used as an alternative data source to Squirro backend.

...