Skip to content

Commit

Permalink
fix: index main subfield for text_lang
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Sep 25, 2023
1 parent f710aa0 commit 94a764f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def generate_dsl_field(field: FieldConfig, supported_langs: Iterable[str]):
lang: Text(analyzer=analyzer(ANALYZER_LANG_MAPPING.get(lang, "standard")))
for lang in supported_langs
}
if field.type is FieldType.text_lang:
# Add subfield used to save main language version for `text_lang`
properties["main"] = Text(analyzer=analyzer("standard"))
return Object(required=field.required, dynamic=False, properties=properties)
elif field.type == FieldType.object:
return Object(required=field.required, dynamic=True)
Expand Down

0 comments on commit 94a764f

Please sign in to comment.