Oscar provides a search view that extends Haystack’s FacetedSearchView to provide better support for faceting.
- Facets are configured using the OSCAR_SEARCH_FACETS setting, which is used to configure the SearchQuerySet instance within the search application class.
- A simple search form is injected into each template context using a context processor oscar.apps.search.context_processors.search_form.
- class oscar.apps.search.views.FacetedSearchView(*args, **kwargs)¶
A modified version of Haystack’s FacetedSearchView
Note that facets are configured when the SearchQuerySet is initialised. This takes place in the search application class.
- class oscar.apps.search.forms.BrowseCategoryForm(*args, **kwargs)¶
Variant of SearchForm that returns all products (instead of none) if no query is specified.
- class oscar.apps.search.forms.SearchForm(*args, **kwargs)¶
In Haystack, the search form is used for interpreting and sub-filtering the SQS.
Validate and return the selected facets
- class oscar.apps.search.forms.SearchInput(attrs=None)¶
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