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

# Find registry items

> Learn how to search for registries, collections, and artifact versions interactively with the UI or programmatically with queries.

レジストリ、コレクション、およびアーティファクトのバージョンを[Registryでインタラクティブに検索する](/ja/products/registry/search_registry#search-for-registry-items)か、W\&B Python SDKで[プログラム的にクエリする](/ja/products/registry/search_registry#query-registry-items)ことができます。

検索結果には、表示する権限を持つ項目のみが表示されます。

<Info>
  Registryをクエリする際に使用できる構文と利用可能なオペレーターは、MongoDBクエリと類似していますが、同一ではありません。
</Info>

<h2 id="search-for-registry-items">
  レジストリ項目を検索する
</h2>

[Registry ホームページの検索バー](/ja/products/registry/search_registry#basic-search)を使用して、コレクションとレジストリを名で検索します。[高度な探索](/ja/products/registry/search_registry#advanced-search)を使用して、名、タグ、説明、作成日などの特定の属性を持つレジストリ、コレクション、アーティファクトのバージョンを検索します。

<h3 id="basic-search">
  基本検索
</h3>

Registry のホームページからレジストリとコレクションを検索します。

1. [https://forge.coreweave.com/registry/](https://forge.coreweave.com/registry/) の Registry にアクセスします。
2. ページ上部の検索バーに検索語を入力します。
3. Enter キーを押して検索します。

<h3 id="advanced-search">
  高度な探索
</h3>

高度な探索を使用して、レジストリ、コレクション、アーティファクトのバージョンを検索します。フィルターを使用すると、名、タグ、説明、作成日などの属性に基づいて、特定のレジストリ項目を検索できます。

1. [https://forge.coreweave.com/registry/](https://forge.coreweave.com/registry/) の Registry にアクセスします。
2. ホームページ上部の **Advanced** をクリックします。
3. **Registries**、**Collections**、または **Versions** ボタンを選択します。
4. **Filters** をクリックします。
5. 左から右の順に、フィルターに使用する属性、オペレーター、値を選択します。複数のフィルターを追加して検索結果を絞り込めます。
6. Enter キーを押してフィルターを適用します。

<h2 id="query-registry-items">
  レジストリ項目をクエリする
</h2>

[`wandb.Api().registries()`](/ja/products/wandb/ref/python/public-api/api#method-api-registries) と*クエリ述語*を使用して、レジストリ、コレクション、アーティファクトのバージョンをフィルターします。クエリ述語は、返される項目が満たすべき基準を指定する条件です。

クエリ述語を作成するには、[クエリ名](/ja/products/registry/search_registry#filterable-fields)、1 つ以上の[オペレーター](/ja/products/registry/search_registry#supported-operators)、値で構成される JSON 形式に似た辞書を使用します。次のコードスニペットは、クエリ述語の一般的な構造を示しています。

```python theme={"system"}
{
    "query_name": {
        "operator": value
    }
}
```

以下のセクションでは、Registry で利用できる[クエリ名](/ja/products/registry/search_registry#filterable-fields)、[サポートされるオペレーター](/ja/products/registry/search_registry#supported-operators)、[クエリの例](/ja/products/registry/search_registry#example-queries)について説明します。

<h3 id="filterable-fields">
  フィルター可能なフィールド
</h3>

次の表は、フィルターしたいアイテムのタイプに基づいて使用できるクエリ名をリストします:

| | query name |
| - | - |
| レジストリ | `name`, `description`, `created_at`, `updated_at` |
| コレクション | `name`, `tag`, `description`, `created_at`, `updated_at` |
| バージョン | `tag`, `alias`, `created_at`, `updated_at`, `metadata` |

<h3 id="supported-operators">
  サポートされるオペレーター
</h3>

W\&B は、レジストリ項目のフィルター処理で次の比較オペレーターと論理オペレーターをサポートします:

<h4 id="comparison-operators">
  比較オペレーター
</h4>

| オペレーター | 説明 |
| - | - |
| `$eq` | 等しい |
| `$ne` | 等しくない |
| `$gt` | より大きい |
| `$gte` | 以上 |
| `$lt` | より小さい |
| `$lte` | 以下 |

<h4 id="logical-operators">
  論理オペレーター
</h4>

| オペレーター | 説明 |
| - | - |
| `$and` | 1つ以上の条件に対して[AND](https://en.wikipedia.org/wiki/Logical_conjunction)の論理を実行します |
| `$or` | 1つ以上の条件に対して[OR](https://en.wikipedia.org/wiki/Logical_disjunction)の論理を実行します |
| `$nor` | 1つ以上の条件に対して[NOR](https://en.wikipedia.org/wiki/Logical_NOR)の論理を実行します |
| `$not` | 条件に対して[NOT](https://en.wikipedia.org/wiki/Negation)の論理を実行します |

<h4 id="other-operators">
  その他のオペレーター
</h4>

| オペレーター | 説明 |
| - | - |
| `$regex` | 正規表現によるパターンマッチング |
| `$exists` | フィールドが存在するかどうか |
| `$contains` | string に値が含まれるかどうか |

<h3 id="example-queries">
  クエリの例
</h3>

以下のコード例では、一般的な検索シナリオをいくつか示します。

`wandb.Api().registries()` メソッドを使用するには、まず W\&B Python SDK ([`wandb`](/ja/products/wandb/ref/python)) ライブラリをインポートします。

```python theme={"system"}
import wandb

# （オプション）読みやすくするために wandb.Api() クラスのインスタンスを作成します
api = wandb.Api()
```

string `model` を含むすべてのレジストリをフィルターします：

```python theme={"system"}
# 文字列 `model` を含むすべてのレジストリをフィルターします
registry_filters = {
    "name": {"$regex": "model"}
}

# フィルターに一致するすべてのレジストリのイテラブルを返します
registries = api.registries(filter=registry_filters)
```

レジストリに関係なく、コレクション名にstring `yolo` を含むすべてのコレクションをフィルターします：

```python theme={"system"}
# レジストリに関係なく、コレクション名に文字列 `yolo` を含む
# すべてのコレクションをフィルターします
collection_filters = {
    "name": {"$regex": "yolo"}
}

# フィルターに一致するすべてのコレクションのイテラブルを返します
collections = api.registries().collections(filter=collection_filters)
```

レジストリに関係なく、コレクション名にstring `yolo` を含み、タグ `cnn` が付いているすべてのコレクションをフィルターします：

```python theme={"system"}
# レジストリに関係なく、コレクション名に文字列 `yolo` を含み、
# タグ `cnn` を持つすべてのコレクションをフィルターします
collection_filters = {
    "name": {"$regex": "yolo"},
    "tag": "cnn"
}

# フィルターに一致するすべてのコレクションのイテラブルを返します
collections = api.registries().collections(filter=collection_filters)
```

string `model` を含み、タグ `image-classification` またはエイリアス `latest` のいずれかを持つアーティファクトのバージョンをすべて検索します：

```python theme={"system"}
# string `model` を含み、タグ `image-classification` または
# エイリアス `latest` を持つすべてのアーティファクトのバージョンを検索します
registry_filters = {
    "name": {"$regex": "model"}
}

# 論理オペレーター $or を使用してアーティファクトのバージョンをフィルターします
version_filters = {
    "$or": [
        {"tag": "image-classification"},
        {"alias": "production"}
    ]
}

# フィルターに一致するすべてのアーティファクトのバージョンのイテラブルを返します
artifacts = api.registries(filter=registry_filters).collections().versions(filter=version_filters)
```

前のコードスニペットの `artifacts` イテラブル内の各項目は、`Artifact` クラスのインスタンスです。そのため、各アーティファクトの `name`、`collection`、`aliases`、`tags`、`created_at` などの属性にアクセスできます。

```python theme={"system"}
for art in artifacts:
    print(f"artifact name: {art.name}")
    print(f"collection artifact belongs to: { art.collection.name}")
    print(f"artifact aliases: {art.aliases}")
    print(f"tags attached to artifact: {art.tags}")
    print(f"artifact created at: {art.created_at}\n")
```

アーティファクト オブジェクトの属性の完全な一覧については、W\&B Python SDK リファレンスドキュメントの[アーティファクト クラス](/ja/products/wandb/ref/python/experiments/artifact)を参照してください。

レジストリやコレクションに関係なく、`2024-01-08` から `2025-03-04` の `13:10 UTC` までに作成されたすべてのアーティファクトのバージョンをフィルターします。

```python theme={"system"}
# 2024-01-08 から 2025-03-04 の 13:10 UTC までに作成されたすべてのアーティファクトのバージョンを検索します。 

artifact_filters = {
    "alias": "latest",
    "created_at" : {"$gte": "2024-01-08", "$lte": "2025-03-04 13:10:00"},
}

# フィルターに一致するすべてのアーティファクトのバージョンのイテラブルを返します
artifacts = api.registries().collections().versions(filter=artifact_filters)
```

<Note>
  `created_at` と `updated_at` のクエリでは、日時を `YYYY-MM-DD HH:MM:SS` 形式で指定してください。日付のみでフィルターする場合は、時、分、秒を省略できます。
</Note>
