> ## 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.