Skip to content

Commit

Permalink
meilisearch "searchableAttributes": []
Browse files Browse the repository at this point in the history
  • Loading branch information
mishig25 committed Jun 27, 2024
1 parent 483cb8b commit 99cfd53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/doc_builder/build_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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.")
7 changes: 7 additions & 0 deletions src/doc_builder/meilisearch_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 99cfd53

Please sign in to comment.