I'm building an ecommerce website with django-oscar and It is a great oscommerce platform but I am struggling to achieve facet filtering by product attribute.
I think I am very close, but despite I've gone trough all the documentation I think it is not clearly explained how to add facet filter by attribute.
I've successfully setup Solr and I have both default facet filters showing up on the frontend (Type and Price range)
What I have done already is that I've added :
<field name="product_attribute_value" type="text_en" indexed="true" stored="true" multiValued="true" />
to my Solr schema.xml
then I have added:
product_attribute_value = indexes.MultiValueField(null=True, faceted=True)
to my search_indexes.py
and then I've added:
('product_attribute_value', {'name': ('Marka'), 'field': 'product_attribute_value'}),
to OSCAR_SEARCH_FACETS in my settings.py
After that Solr is throwing an error:
ERROR org.apache.solr.core.SolrCore – org.apache.solr.common.SolrException: undefined field: "product_attribute_value_exact"
I've tried to add this field to schema.xml, search_indexes.py and to OSCAR_SEARCH_FACETS, but the error remains.
I know I am very close, but most probably i've mistaken the field type or something and I am stuck. Please help me to add a facet filter by product attribute.
My catalogue looks like that:
I have only one product type with only one product attribute, and that product attribute is of type "option" with an option group with a few options.
I want customers to be able to filter products by that attribute.
It is something like that product type - "Part", product attribute - "Carmake", option group - "Carmakes" with options "VW", "Audi", "BMW"
So when the customer gets to the product list of a category all products in that category are displayed, I want them to be able to filter products by facet filter that filters all Parts according to the Carmake.