summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-18 23:33:56 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-19 18:06:55 +0100
commitc9e7e5478aed8757821827e8f5358d7959257a2d (patch)
treed27d1e598f6e665f0bd624cc1523440008ba7697 /archaeological_context_records
parentc2691ba59e40433b46b6c8aa3d362c56e6262788 (diff)
downloadIshtar-c9e7e5478aed8757821827e8f5358d7959257a2d.tar.bz2
Ishtar-c9e7e5478aed8757821827e8f5358d7959257a2d.zip
Free search: "raw" index for reference - improve parent only search
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/models.py4
-rw-r--r--archaeological_context_records/tests.py5
2 files changed, 5 insertions, 4 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 72a835cc2..074bc3358 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -635,10 +635,10 @@ class ContextRecord(
PARENT_ONLY_SEARCH_VECTORS = ["operation", "archaeological_site", "parcel"]
BASE_SEARCH_VECTORS = [
- SearchVectorConfig("cached_label"),
- SearchVectorConfig("label"),
+ SearchVectorConfig("label", "raw"),
SearchVectorConfig("location"),
SearchVectorConfig("town__name"),
+ SearchVectorConfig("town__numero_insee", "raw"),
SearchVectorConfig("interpretation", "local"),
SearchVectorConfig("filling", "local"),
SearchVectorConfig("datings_comment", "local"),
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py
index 9842340f3..f0b12e0d6 100644
--- a/archaeological_context_records/tests.py
+++ b/archaeological_context_records/tests.py
@@ -429,8 +429,9 @@ class ContextRecordTest(ContextRecordInit, TestCase):
self.assertIsNotNone(cr.search_vector)
for key in ("label", "heeer"):
self.assertIn(key, cr.search_vector)
- cr.operation.code_patriarche = "PATRIARCHE"
- cr.operation.save()
+ operation = models_ope.Operation.objects.get(pk=cr.operation.pk)
+ operation.code_patriarche = "PATRIARCHE"
+ operation.save()
cr = models.ContextRecord.objects.get(pk=cr.pk)
profile = get_current_profile()