# games.gamesgamesgamesgames.reindexSearchGames

> Queue a job that finds games whose search document is missing, gutted or stale, and rewrites those documents from the index. Admins only. One search reindex runs at a time, and none while a catalogue reindex is pending or running. Run with dryRun first.

- Kind: procedure
- Authority: gamesgamesgamesgames.games
- Lexicon: 1
- Published by [gamesgamesgamesgames.games](https://lexicon.garden/identity/did:web:gamesgamesgamesgames.games), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:web:gamesgamesgamesgames.games/games.gamesgamesgamesgames.reindexSearchGames)
- [Schema JSON](https://lexicon.garden/lexicon/did:web:gamesgamesgamesgames.games/games.gamesgamesgamesgames.reindexSearchGames/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:web:gamesgamesgamesgames.games/games.gamesgamesgamesgames.reindexSearchGames/analytics)

## Procedure (`games.gamesgamesgamesgames.reindexSearchGames`)

Type: procedure · POST

### Input (application/json)

- `after` (string · at-uri): Resume a full scan after this game URI, such as the after of a stopped run. Cannot be combined with uris.
- `dryRun` (boolean): Compare only, and report what would be rewritten.
  - Constraints: default: false
- `maxGames` (integer): Stop after checking this many games, for a trial run.
  - Constraints: minimum: 1
- `uris` (array): Only check these game URIs. Without it, the job checks every game.
  - Constraints: minLength: 1, maxLength: 5000
  - `items` (string · at-uri)

### Output (application/json)

- `alreadyQueued` (boolean): True when a search reindex was already pending or running; jobId is that job, and nothing new was queued.
- `jobId` (string, required)
  - Constraints: maxLength: 128
- `status` (string): The existing job's status, when alreadyQueued is true.
  - Constraints: maxLength: 32, knownValues: pending | running

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Queue a job that finds games whose search document is missing, gutted or stale, and rewrites those documents from the index. Admins only. One search reindex runs at a time, and none while a catalogue reindex is pending or running. Run with dryRun first.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "after": {
              "description": "Resume a full scan after this game URI, such as the after of a stopped run. Cannot be combined with uris.",
              "format": "at-uri",
              "type": "string"
            },
            "dryRun": {
              "default": false,
              "description": "Compare only, and report what would be rewritten.",
              "type": "boolean"
            },
            "maxGames": {
              "description": "Stop after checking this many games, for a trial run.",
              "minimum": 1,
              "type": "integer"
            },
            "uris": {
              "description": "Only check these game URIs. Without it, the job checks every game.",
              "items": {
                "format": "at-uri",
                "type": "string"
              },
              "maxLength": 5000,
              "minLength": 1,
              "type": "array"
            }
          },
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "alreadyQueued": {
              "description": "True when a search reindex was already pending or running; jobId is that job, and nothing new was queued.",
              "type": "boolean"
            },
            "jobId": {
              "maxLength": 128,
              "type": "string"
            },
            "status": {
              "description": "The existing job's status, when alreadyQueued is true.",
              "knownValues": [
                "pending",
                "running"
              ],
              "maxLength": 32,
              "type": "string"
            }
          },
          "required": [
            "jobId"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "games.gamesgamesgamesgames.reindexSearchGames",
  "lexicon": 1
}
```
