summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.md1
-rw-r--r--archaeological_files/models.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 7ba5306bc..173e59be3 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -26,6 +26,7 @@ Ishtar changelog
- Free text search:
- use accent and unaccented string
- add french_archeo thesaurus config
+ - File - add "year-index"
- Maintenance scripts: delete deprecated and migrate to ishtar_maintenance
### Bug fixes ###
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 527138425..d1caaea49 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -432,6 +432,9 @@ class File(
SearchVectorConfig("comment", "local"),
SearchVectorConfig("research_comment", "local"),
]
+ PROPERTY_SEARCH_VECTORS = [
+ SearchVectorConfig("year_ref", "raw"),
+ ]
INT_SEARCH_VECTORS = [
SearchVectorConfig("numeric_reference"),
SearchVectorConfig("year"),
@@ -780,6 +783,10 @@ class File(
return "{}{}".format(settings.ISHTAR_FILE_PREFIX or "", self.external_id or "")
@property
+ def year_ref(self):
+ return f"{self.year}-{self.numeric_reference or 0}"
+
+ @property
def delay_date(self):
cache_key, val = get_cache(self.__class__, [self.pk, "delay_date"])
if val: