Skip to content
Snippets Groups Projects
Commit e70b3a91 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

fix issue with refseqsanitized index

parent 2584422b
No related branches found
No related tags found
No related merge requests found
Pipeline #128523 failed
......@@ -281,7 +281,7 @@ lint:
df-wiki-cli meilisearch
--host ${MEILI_HOST}
--key "${MEILI_MASTER_KEY}"
index-update refseqsanitized index
index-update refseqsanitized sys_id
- >
df-wiki-cli
meilisearch
......
......@@ -52,7 +52,8 @@ def main(
def delete_all_documents(ctx: typer.Context, id: str):
client = meilisearch.Client(ctx.obj.host, ctx.obj.key)
index = client.index(id)
index.delete_all_documents()
tasks = index.delete_all_documents()
console.print(tasks)
@app.command()
......
......@@ -523,7 +523,7 @@ def split_on_comma(str_val: Optional[str]) -> Optional[List[str]]:
return None
def update_refseq(client, document, file):
def update_refseq(client, document, file, primary_key="sys_id"):
index = client.index(document.lower())
documents = []
with open(file, "r") as csvfile:
......@@ -536,7 +536,7 @@ def update_refseq(client, document, file):
row["accession_in_sys"] = split_on_comma(row["accession_in_sys"])
doc = RefSeqCsv(**row)
documents.append(doc.model_dump(by_alias=True))
tasks = index.add_documents_in_batches(documents, primary_key="sys_id")
tasks = index.add_documents_in_batches(documents, primary_key=primary_key)
for task in tasks:
console.print(task)
index.update_pagination_settings({"maxTotalHits": 1000000})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment