@elastic/enterprise-search

中文文档
8.18.0发布于 2025/04/22Apache-2.0TypeScriptCommonJS近 30 天下载 3.3万

Elastic Entertainment Search, App Search, and Worlds Search的官方Node.js客户端.

中文使用文档
文档目录3 节
  1. 安装
  2. 快开始
  3. 许可证

: 警告: 应用程序搜索和工作场所搜索将在 9. 0 中停止

从"弹性"9.0版本开始,独立"企业搜索"产品将不再纳入我们的提供范围. 它们在8.x版本中仍然以目前的形式得到支持,只接受安全升级和修正. 根据我们的数据,企业搜索客户将在整个8个版本中继续以目前的形式得到支持 EL 政策。 。 。 . 我们建议向积极发展的转变 弹性堆栈 用于搜索的工具。 但是,如果你仍然使用任何企业搜索产品, 我们建议使用最新的稳定发布客户.

以下是一些与更多信息的有用链接:

Elastic Enterprise Search

js-standard-style Build Status。 。 。 . Node CI

Elastic Entertainment Search, App Search, and Worlds Search的官方Node.js客户端.

: 信息 来源:读取 完整文档 对于此客户端 : 弹性.co。 。 。 .

安装

npm install @elastic/enterprise-search

快开始

const { Client } = require('@elastic/enterprise-search')
const client = new Client({
  url: 'http://localhost:3002',
  // basic auth
  auth: {
    username: 'elastic',
    password: 'changeme'
  }
  // bearer auth
  auth: {
    token: 'my-token'
  }
})

// Enterprise Search API
const response = await client.enterprise.getHealth()
console.log(response)

// App Search API
const response = await client.app.search({
  engine_name: 'games',
  body: {
    query: 'Pack-Man'
  }
})
console.log(response)

// Workplace Search API
const response = await client.workplace.getDocument({
  content_source_id: 'test',
  document_id: 'id'
})
console.log(response)

许可证

该软件根据 Apache 2 许可证。 。 。 .

版本与发布记录

@elastic/enterprise-search 共发布 5 个版本,首次发布于 2022/03/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
8.18.0latest2025/04/221.6 年前
8.6.12023/11/152 年前
8.6.02023/01/283 年前
8.1.1-beta.12022/11/044 年前
8.1.0-beta.12022/03/224 年前

关于 @elastic/enterprise-search 的常见问题

@elastic/enterprise-search 是什么?

Elastic Entertainment Search, App Search, and Worlds Search的官方Node.js客户端.

如何安装 @elastic/enterprise-search?

在项目目录运行 npm install @elastic/enterprise-search,或使用 pnpm add / yarn add / bun add。

@elastic/enterprise-search 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@elastic/enterprise-search 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@elastic/enterprise-search 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@elastic/enterprise-search 可以商用吗?

@elastic/enterprise-search 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@elastic/enterprise-search 的下载量有多少?

根据 npm 官方下载统计,@elastic/enterprise-search 在 2026/10/14 – 2026/11/12 这 30 天内被下载 33,347 次,日均约 1,112 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elastic/enterprise-search 还在维护吗?

最新版本 8.18.0 发布于 2025/04/22(1.6 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/03/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。