summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-03-20 17:26:31 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-24 19:41:37 +0200
commit3920c6a34eaddee7397a93d08487194a5119e74f (patch)
tree4b6301374d3f3e57102e9ef267ba9643864fea53 /archaeological_context_records/models.py
parentcffe0a8f34ebf72bebbb7c34ed994ada41c6f73c (diff)
downloadIshtar-3920c6a34eaddee7397a93d08487194a5119e74f.tar.bz2
Ishtar-3920c6a34eaddee7397a93d08487194a5119e74f.zip
Search: manage localized and non localized indexation
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py21
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"),