diff --git a/src/doc_builder/build_embeddings.py b/src/doc_builder/build_embeddings.py index 5a49ba92..a5399256 100644 --- a/src/doc_builder/build_embeddings.py +++ b/src/doc_builder/build_embeddings.py @@ -29,7 +29,13 @@ from .autodoc import autodoc_markdown, resolve_links_in_text from .convert_md_to_mdx import process_md from .convert_rst_to_mdx import find_indent, is_empty_line -from .meilisearch_helper import add_embeddings_to_db, create_embedding_db, delete_embedding_db, swap_indexes +from .meilisearch_helper import ( + add_embeddings_to_db, + create_embedding_db, + delete_embedding_db, + swap_indexes, + update_db_settings, +) from .utils import chunk_list, read_doc_config @@ -474,4 +480,5 @@ def clean_meilisearch(meilisearch_key: str): swap_indexes(client, MEILI_INDEX, MEILI_INDEX_TEMP) delete_embedding_db(client, MEILI_INDEX_TEMP) create_embedding_db(client, MEILI_INDEX_TEMP) + update_db_settings(client, MEILI_INDEX_TEMP) print("[meilisearch] successfully swapped & deleted temp index.") diff --git a/src/doc_builder/meilisearch_helper.py b/src/doc_builder/meilisearch_helper.py index fbaa6b97..64cb0724 100644 --- a/src/doc_builder/meilisearch_helper.py +++ b/src/doc_builder/meilisearch_helper.py @@ -60,6 +60,13 @@ def create_embedding_db(client: Client, index_name: str): return client, task_info +@wait_for_task_completion +def update_db_settings(client: Client, index_name: str): + index = client.index(index_name) + task_info = index.update_settings({"searchableAttributes": []}) + return client, task_info + + @wait_for_task_completion def delete_embedding_db(client: Client, index_name: str): index = client.index(index_name)