> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 文档重排序

> 使用 TypeScript SDK 按照候选文档与查询的相关性重新排序。

使用 `client.rerank.create()` 可根据候选文档与查询的相关性对其排序。

```typescript theme={null}
import Phaseo from "@phaseo/sdk";

const client = new Phaseo({ apiKey: process.env.PHASEO_API_KEY! });

const result = await client.rerank.create({
  model: "voyage/rerank-2",
  query: "How do I check whether a model is routable?",
  documents: [
    "Call GET /v1/models and use the default availability filter.",
    "Create an image with POST /v1/images/generations.",
  ],
});

console.log(result.results);
```

在生产环境中使用前，请通过 `GET /v1/models` 确认模型 ID。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.