django-haystack filter engine with elastic search backend. It gaves a list of all engine but i want to display only one engine that matches with maker

13 views
Skip to first unread message

Priyanka patil

unread,
Oct 14, 2019, 12:27:42 PM10/14/19
to Django users

class PartLookUpHaystackSerializer(HaystackFacetSerializer):

    serialize_objects = True

    class Meta:
        # The `index_classes` attribute is a list of which search indexes
        # we want to include in the search.
        index_classes = [PartIndex]

        
        # The `fields` contains all the fields we want to include.
        NOTE: Make sure you don't confuse these with model attributes. These
        # fields belong to the search index!
        fields = [
            'title''description''partnumber''make''make_slug''year''fitment_model''fitment_model_slug''engine''parttype_slug'
            'parttype''submodel''subcategory''engine''slug''id''coreprice''price''images''mfg_name''mfg_name_slug',
            'sub_title''zipcode''third_party_name''quantity''modified_price''core_price''part_warranty''minimum_order_qty'

        ]

        field_options = {
            'title': {},
            'description': {},
            'make_slug':{},
            'year':{},
            'fitment_model_slug':{},
            'parttype_slug':{},
            'submodel':{},
            'subcategory':{},
            'engine':{},
            'mfg_name':{},
            'mfg_name_slug':{}
        }

Reply all
Reply to author
Forward
0 new messages