我如何根据 haystack rest api 中的不同值对 elasticsearch 进行动态索引?

问题描述

DocumentStore 用于索引。 我使用过 elasticsearch.ElasticsearchDocumentStore。 但是不要为每个新索引更改哪里。我想在文件上传时通过并想创建新索引。 文件上传代码如下

for file in files:
    try:
        file_path = Path(FILE_UPLOAD_PATH) / f"{uuid.uuid4().hex}_{file.filename}"
        with file_path.open("wb") as buffer:
            shutil.copyfileobj(file.file,buffer)

        file_paths.append(file_path)
        Meta["name"] = file.filename
        file_Metas.append(Meta)
    finally:
        file.file.close()

INDEXING_PIPELINE.run(
        file_paths=file_paths,remove_numeric_tables=remove_numeric_tables,remove_whitespace=remove_whitespace,remove_empty_lines=remove_empty_lines,remove_header_footer=remove_header_footer,valid_languages=valid_languages,split_by=split_by,split_length=split_length,split_overlap=split_overlap,split_respect_sentence_boundary=split_respect_sentence_boundary,Meta=file_Metas,)

任何人都可以帮我解决这个问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...