diff options
Diffstat (limited to 'archaeological_finds/models_finds.py')
| -rw-r--r-- | archaeological_finds/models_finds.py | 37 | 
1 files changed, 28 insertions, 9 deletions
| diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index e93580418..f2897b02d 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -41,7 +41,7 @@ from ishtar_common.models import Document, GeneralType, \      ValueGetter, get_current_profile, IshtarSiteProfile, PRIVATE_FIELDS, \      GeoItem, BulkUpdatedItem, ExternalIdManager, QuickAction, \      MainItem, document_attached_changed, HistoryModel, DynamicRequest, \ -    SearchAltName, QRCodeItem +    SearchAltName, QRCodeItem, SearchVectorConfig  from archaeological_operations.models import AdministrativeAct, Operation @@ -304,8 +304,14 @@ class BaseFind(BulkUpdatedItem, BaseHistorizedItem, GeoItem, OwnPerms):      RELATED_POST_PROCESS = ['find']      CACHED_LABELS = ['cache_short_id', 'cache_complete_id']      PARENT_SEARCH_VECTORS = ['context_record'] -    BASE_SEARCH_VECTORS = ["label", "description", "comment", "cache_short_id", -                           "cache_complete_id", "excavation_id"] +    BASE_SEARCH_VECTORS = [ +        SearchVectorConfig("label"), +        SearchVectorConfig("description", "local"), +        SearchVectorConfig("comment", "local"), +        SearchVectorConfig("cache_short_id"), +        SearchVectorConfig("cache_complete_id"), +        SearchVectorConfig("excavation_id"), +    ]      objects = ExternalIdManager()      class Meta: @@ -1280,14 +1286,27 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, QRCodeItem,      PARENT_SEARCH_VECTORS = ['base_finds']      BASE_SEARCH_VECTORS = [ -        "cached_label", "label", "description", "container__location__name", -        "container__reference", "mark", "comment", "dating_comment", -        "previous_id", "denomination", "museum_id", "decoration", -        "manufacturing_place" +        SearchVectorConfig("cached_label"), +        SearchVectorConfig("label"), +        SearchVectorConfig("description", "local"), +        SearchVectorConfig("container__location__name"), +        SearchVectorConfig("container__reference"), +        SearchVectorConfig("mark"), +        SearchVectorConfig("comment", "local"), +        SearchVectorConfig("dating_comment", "local"), +        SearchVectorConfig("previous_id"), +        SearchVectorConfig("denomination"), +        SearchVectorConfig("museum_id"), +        SearchVectorConfig("decoration"), +        SearchVectorConfig("manufacturing_place"),      ]      M2M_SEARCH_VECTORS = [ -        "datings__period__label", "object_types__label", "integrities__label", -        "remarkabilities__label", "material_types__label"] +        SearchVectorConfig("datings__period__label", "local"), +        SearchVectorConfig("object_types__label", "local"), +        SearchVectorConfig("integrities__label"), +        SearchVectorConfig("remarkabilities__label", "local"), +        SearchVectorConfig("material_types__label", "local"), +    ]      QA_EDIT = QuickAction(          url="find-qa-bulk-update", icon_class="fa fa-pencil", | 
