diff --git a/src/memopol/search_indexes.py b/src/memopol/search_indexes.py index 2caf61596860311f5f28a0fbfab0900d4aeddf44..c64910e4f03a72fa2774b703e5ad63c81ead7009 100644 --- a/src/memopol/search_indexes.py +++ b/src/memopol/search_indexes.py @@ -1,7 +1,7 @@ +#TODO sputnick: c from haystack import indexes from representatives.models import Representative - class RepresentativeIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.EdgeNgramField(document=True, use_template=True) slug = indexes.CharField(model_attr='slug', faceted=True) @@ -9,6 +9,9 @@ class RepresentativeIndex(indexes.SearchIndex, indexes.Indexable): last_name = indexes.CharField(model_attr='last_name', faceted=True) full_name = indexes.EdgeNgramField(model_attr='full_name') ascii_name = indexes.NgramField(model_attr='ascii_name') + #new mappings (check src/representatives/models.py) + score = indexes.IntegerField(model_attr='representative_score') # simple field + mandates = MultiValueField() # iterable, check Okhin's UML (country, chamber, party...) => https://django-haystack.readthedocs.io/en/v2.4.1/searchindex_api.html?highlight=MultiValueField def get_model(self): return Representative