使用@elastic/enterprise

编程入门 行业动态 更新时间:2024-10-05 07:25:21

使用@<a href=https://www.elefans.com/category/jswz/34/1771232.html style=elastic/enterprise"/>

使用@elastic/enterprise

在我的 NodeJs API 中,我无法查询由多个单一引擎组成的 元引擎。 我需要通过 ID 列表过滤文档。

我正在使用 @elastic/enterprise-search 包版本 8.6.0

我尝试使用客户端方法 getDocuments(),但它没有找到任何内容并返回一个空值列表。 如果我尝试这样的事情:

const { Client } = require('@elastic/enterprise-search');

const client = () =>
    new Client({
        url: process.env.ELASTIC_SEARCH_URL,
        auth: {
            token: process.env.ELASTIC_SEARCH_KEY,
        },
    });

const searchItemsFromMetaEngineAppSearch = async (engine, idList) => {
    const requests = idList.map((id) => {
        return {
            index: engine,
            body: {
                query: {
                    ids: {
                        values: [id],
                    },
                },
            },
        };
    });

    const documents = await client().app.search({
        body: requests,
    });
    return documents;
};

...我收到错误消息“找不到引擎”。

网上关于查询元引擎的信息不多。 非常感谢帮助!

回答如下:

更多推荐

使用@elastic/enterprise

本文发布于:2024-05-30 14:15:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1770583.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:elastic   enterprise

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!