fix twelve channels search facets

This commit is contained in:
ShivaniKhaire 2026-09-29 17:33:16 +05:30
parent 64d5097e1b
commit 054aa7a073
1 changed files with 16 additions and 0 deletions

View File

@ -293,6 +293,22 @@ class SearchRepository:
def _project_value(self, raw: Any, strategy: str) -> list[ProjectionValue]:
strategy = strategy.strip().lower()
raw_values = _flatten_projection_values(raw)
if strategy in ("multivalue", "comma_delimited", "delimited"):
split_values: list[str] = []
for item in raw_values:
if "," in item or ";" in item:
for token in item.replace(";", ",").split(","):
cleaned = token.strip().rstrip(".").strip()
if cleaned:
cleaned = cleaned[:1].upper() + cleaned[1:]
split_values.append(cleaned)
else:
cleaned = item.strip().rstrip(".").strip()
if cleaned:
cleaned = cleaned[:1].upper() + cleaned[1:]
split_values.append(cleaned)
raw_values = split_values
projected: list[ProjectionValue] = []
seen: set[str] = set()
for label in raw_values: