Skip to content

Commit

Permalink
fix: use versioned index name instead of alias to get mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
BeritJanssen committed Jan 15, 2025
1 parent be501d7 commit cd4999f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/es/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def get(self, request, *args, **kwargs):

def find_named_entity_fields(self, client, index: str) -> list[str]:
mapping = client.indices.get_mapping(index=index)
fields = mapping[index]['mappings']['properties']
index_name = list(mapping.keys())[0]
fields = mapping[index_name]['mappings']['properties']
field_names = fields.keys()
return [name for name in field_names if name.endswith(':ner')]

Expand Down

0 comments on commit cd4999f

Please sign in to comment.