diff options
Diffstat (limited to 'archaeological_context_records/models.py')
| -rw-r--r-- | archaeological_context_records/models.py | 21 | 
1 files changed, 15 insertions, 6 deletions
| diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 6dad4f600..c88e60249 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -35,7 +35,7 @@ from ishtar_common.models import Document, GeneralType, \      GeneralRelationType, GeneralRecordRelations, post_delete_record_relation,\      post_save_cache, ValueGetter, BulkUpdatedItem, ExternalIdManager, \      RelationItem, Town, get_current_profile, document_attached_changed, \ -    HistoryModel, SearchAltName, GeoItem, QRCodeItem +    HistoryModel, SearchAltName, GeoItem, QRCodeItem, SearchVectorConfig  from archaeological_operations.models import Operation, Period, Parcel, \      ArchaeologicalSite @@ -377,11 +377,20 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, QRCodeItem, GeoItem,      }      PARENT_ONLY_SEARCH_VECTORS = ["operation", "archaeological_site", "parcel"] -    BASE_SEARCH_VECTORS = ["cached_label", "label", "location", "town__name", -                           "interpretation", "filling", "datings_comment", -                           "identification__label", "activity__label", -                           "excavation_technic__label"] -    M2M_SEARCH_VECTORS = ["datings__period__label"] +    BASE_SEARCH_VECTORS = [ +        SearchVectorConfig("cached_label"), +        SearchVectorConfig("label"), +        SearchVectorConfig("location"), +        SearchVectorConfig("town__name"), +        SearchVectorConfig("interpretation", 'local'), +        SearchVectorConfig("filling", 'local'), +        SearchVectorConfig("datings_comment", 'local'), +        SearchVectorConfig("identification__label"), +        SearchVectorConfig("activity__label"), +        SearchVectorConfig("excavation_technic__label")] +    M2M_SEARCH_VECTORS = [ +        SearchVectorConfig("datings__period__label", 'local') +    ]      UP_MODEL_QUERY = {          "operation": (              pgettext_lazy("key for text search", u"operation"), | 
