summaryrefslogtreecommitdiff
path: root/ishtar_common/models_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r--ishtar_common/models_common.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index 13447a4d3..bb786d48d 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -1013,6 +1013,7 @@ class FullSearch(models.Model):
SEPS = [" ", "-", "/"]
values = []
# split ID terms
+ # MNP 1995-1-1/42 -> ("MNP", "1995", "1", "42")
for idx, sep in enumerate(SEPS):
if not idx:
values = value.split(sep)
@@ -1021,9 +1022,13 @@ class FullSearch(models.Model):
for val in values:
new_values += val.split(sep)
values = new_values
+ # stock also ID with separators
+ # MNP 1995-1-1 -> ("MNP", "1995-1-1")
+ for v in value.split(" "):
+ if v not in values:
+ values.append(v)
+ values = list(set(values))
for val in values:
- if len(val) < 2:
- continue
val = val.replace("'", "").lower()
result.append(f"'{val}':1")
return result