upstash-search-js

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Upstash Search Documentation

Upstash Search 文档

Quick Start

快速入门

Install the TS SDK:
npm install @upstash/search
Create a client and perform a simple upsert + search:
import { Search } from "@upstash/search";

const client = new Search({ url: process.env.UPSTASH_SEARCH_REST_URL, token: process.env.UPSTASH_SEARCH_REST_TOKEN });
const index = client.index("my-index");

await index.upsert({ id: "1", content: { text: "hello world" } });
const results = await index.search({ query: "hello" });
Basic steps:
  • Create an index
  • Insert or update documents
  • Run searches or filtered queries
安装TS SDK:
npm install @upstash/search
创建客户端并执行简单的插入更新+搜索操作:
import { Search } from "@upstash/search";

const client = new Search({ url: process.env.UPSTASH_SEARCH_REST_URL, token: process.env.UPSTASH_SEARCH_REST_TOKEN });
const index = client.index("my-index");

await index.upsert({ id: "1", content: { text: "hello world" } });
const results = await index.search({ query: "hello" });
基本步骤:
  • 创建索引
  • 插入或更新文档
  • 运行搜索或过滤查询

Other Skill Files

其他技能文件

sdk-overview

sdk-overview

Provides detailed documentation for all TypeScript SDK commands. Includes:
  • delete: Deleting documents
  • fetch: Retrieving a document
  • info: Index info
  • range: Range queries
  • reset: Clearing an index
  • search: Search queries
  • upsert: Adding/updating documents
  • getting-started: Setup steps for the SDK
提供所有TypeScript SDK命令的详细文档,包括:
  • delete:删除文档
  • fetch:检索文档
  • info:索引信息
  • range:范围查询
  • reset:清空索引
  • search:搜索查询
  • upsert:添加/更新文档
  • getting-started:SDK设置步骤

quick-start

quick-start

Provides a fast, end-to-end workflow for creating a Search database, adding documents, and querying them. Covers essential concepts including:
  • Creating a database and storing credentials
  • Adding documents with content and metadata
  • Understanding content vs metadata (searchability and filterability)
  • Performing searches with optional reranking
  • Filtering syntax with SQL-like or structured filters
  • Common pitfalls and best practices
提供创建Search数据库、添加文档并查询的完整快速流程。涵盖核心概念,包括:
  • 创建数据库并存储凭证
  • 添加包含内容和元数据的文档
  • 理解内容与元数据的区别(可搜索性与可过滤性)
  • 执行带可选重排序的搜索
  • 类SQL或结构化过滤语法
  • 常见陷阱与最佳实践