diff --git a/.github/workflows/algolia/configure-algolia-api.py b/.github/workflows/algolia/configure-algolia-api.py index ad1e13851d13..be920acda8bf 100644 --- a/.github/workflows/algolia/configure-algolia-api.py +++ b/.github/workflows/algolia/configure-algolia-api.py @@ -9,6 +9,15 @@ index_name = os.environ["ALGOLIA_INDEX"] +ONE_WAY_SYNONYMS = { + # A list of search terms that have (historically) not returned results + # that we can map to existing search terms that we know are good + "md5": ["hashbytes"], + "fetchdf": ["to_pandas", "to_polars", "to_pyarrow"], + "unique": ["distinct"], +} + + def main(): client = SearchClient.create(app_id, api_key) index = client.init_index(index_name) @@ -30,6 +39,16 @@ def main(): index.set_settings(override_default_settings) + for input_, synonyms in ONE_WAY_SYNONYMS.items(): + index.save_synonym( + { + "objectID": input_, + "type": "oneWaySynonym", + "input": input_, + "synonyms": synonyms, + } + ) + if __name__ == "__main__": main()