Skip to content

Commit

Permalink
improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunnjpl committed Oct 10, 2024
1 parent 5e2fa2e commit f3dfc41
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pds/registrysweepers/utils/db/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@


def ensure_index_mapping(client: OpenSearch, index_name: str, property_name: str, property_type: str):
"""Provides an easy-to-use wrapper for ensuring the presence of a given property name/type in a given index"""
"""
Provides an easy-to-use wrapper for ensuring the presence of a given property name/type in a given index.
N.B. This cannot change the type of a mapping, as modification/deletion is impossible in ES/OS. If the mapping
already exists, matching type or not, the function will gracefully fail and log an HTTP400 error.
"""
client.indices.put_mapping(index=index_name, body={"properties": {property_name: {"type": property_type}}})

0 comments on commit f3dfc41

Please sign in to comment.