Oscar provides a search view that extends Haystack’s
provide better support for faceting.
Facets are configured using the
OSCAR_SEARCH_FACETSsetting, which is used to configure the
SearchQuerySetinstance within the search application class.
A simple search form is injected into each template context using a context processor
A modified version of Haystack’s FacetedSearchView
Note that facets are configured when the
SearchQuerySetis initialised. This takes place in the search application class.
Allows the addition of more context variables as needed.
Must return a dictionary.
Fetches the results via the form.
Returns an empty list if there’s no query to search with.
Variant of SearchForm that returns all products (instead of none) if no query is specified.
Return Queryset of all the results.
In Haystack, the search form is used for interpreting and sub-filtering the SQS.
Validate and return the selected facets
Defining a search type widget
This is an HTML5 thing and works nicely with Safari, other browsers default back to using the default “text” type