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
发布评论