Search¶
Oscar provides a search view that extends Haystack’s FacetedSearchView to
provide better support for faceting.
- Facets are configured using the
OSCAR_SEARCH_FACETSsetting, which is used to configure theSearchQuerySetinstance 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.
Views¶
-
class
oscar.apps.search.views.FacetedSearchView(*args, **kwargs)[source]¶ A modified version of Haystack’s FacetedSearchView
Note that facets are configured when the
SearchQuerySetis initialised. This takes place in the search application class.See https://django-haystack.readthedocs.io/en/v2.1.0/views_and_forms.html#facetedsearchform # noqa
Forms¶
-
class
oscar.apps.search.forms.BrowseCategoryForm(*args, **kwargs)[source]¶ Variant of SearchForm that returns all products (instead of none) if no query is specified.