# @ecomplus/search-engine 中文文档

规范地址：https://npmcn.com/package/%40ecomplus/search-engine/

版本：2\.6\.1
npm 元数据更新时间：2022-04-05T06:38:20.971Z
中文译文更新时间：2026-11-13T05:58:55.415Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40ecomplus/search-engine
原文对照：https://npmcn.com/package/%40ecomplus/search-engine/?lang=original
项目主页：https://github.com/ecomplus/search-engine#readme
源码仓库：https://github.com/ecomplus/search-engine

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.6 MB，52 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：未声明
- 运行依赖：4 个
- peer 依赖：@ecomplus/utils ^1\.4\.1
- 首次发布：2019-07-29T20:44:02.439Z
- 最新版本发布：2021-06-16T00:39:41.714Z
- 近 30 天下载量：3989（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：35（近 12 个月 0 个）

## 中文简介

JS Lib,负责与E-Com Plus商店进行产品搜索

## 安装

```sh
npm install @ecomplus/search-engine
```

也可以使用：`pnpm add @ecomplus/search-engine`、`yarn add @ecomplus/search-engine`、`bun add @ecomplus/search-engine`

## README

# 电子通讯+搜索引擎

[![Publish](https://github.com/ecomplus/search-engine/workflows/Publish/badge.svg)](https://github.com/ecomplus/search-engine/actions?workflow=Publish) [![CodeFactor](https://www.codefactor.io/repository/github/ecomplus/search-engine/badge)](https://www.codefactor.io/repository/github/ecomplus/search-engine) [![npm version](https://img.shields.io/npm/v/@ecomplus/search-engine.svg)](https://www.npmjs.org/@ecomplus/search-engine) [![License MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

UMD JS lib 处理产品搜索 E-Com Plus 商店

[变化](https://github.com/ecomplus/search-engine/blob/master/CHANGELOG.md)

## 使用量

这个 `@ecomplus/search-engine` 软件包是一个包 [电子商务+搜索 API](https://developers.e-com.plus/docs/api/#/search/),可用于处理一个完整的功能产品搜索系统,从简单的项目搜索到应用多个过滤器和聚合.

它既适用于Node.js环境,也适用于浏览器环境.

-   [开始吧](https://developers.e-com.plus/search-engine/module-@ecomplus_search-engine.html)
-   [类参考](https://developers.e-com.plus/search-engine/EcomSearch.html)

### 示例

```js
import EcomSearch from '@ecomplus/search-engine'

const search = new EcomSearch()

search.setSearchTerm('smartphone').fetch()
  .then(result => {
    search.getItems().forEach(item => {
      console.log(item.name)
    })
  })
  .catch(error => {
    console.error(error)
    if (error.response) {
      console.log(error.response)
    }
  })
```

### 安装

这个 _可能_ 需要但不包括 `core-js` (可选)和 [`@ecomplus/utils`](https://developers.e-com.plus/utils/) (同类依赖).

#### 网络软件包

```bash
npm i --save core-js @ecomplus/utils @ecomplus/search-engine
```

#### 节点.js

```bash
npm i --save @ecomplus/utils @ecomplus/search-engine
```

#### 光盘N

```html
<script src="https://cdn.jsdelivr.net/npm/@ecomplus/search-engine/dist/ecom-search.var.min.js"></script>
```

在从CDN进口时, `_.cloneDeep`, (中文(简体) ), `_.merge`, (中文(简体) ), `ecomUtils` 财务报告和审定财务报表 `ecomClient` 图书馆 **必须单独列入** 并可在窗口瞄准镜上找到.

## 常见问题

### @ecomplus/search-engine 是什么？

JS Lib,负责与E-Com Plus商店进行产品搜索

### 如何安装 @ecomplus/search-engine？

在项目目录运行 npm install @ecomplus/search-engine，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@ecomplus/utils（^1\.4\.1）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @ecomplus/search-engine 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/ecomplus\_\_search-engine 是否存在。

### @ecomplus/search-engine 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @ecomplus/search-engine 可以商用吗？

@ecomplus/search-engine 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @ecomplus/search-engine 的下载量有多少？

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

### @ecomplus/search-engine 还在维护吗？

最新版本 2\.6\.1 发布于 2021/06/16（5 年前）；至今共发布 35 个版本，其中过去 12 个月发布了 0 个；首次发布于 2019/07/30。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

