API version: dev

---

# `cron:reindex-files`

Re-syncs an element's `file` metadata (see the [file reference](/reference/file.md#metadata)) into
Elasticsearch for elements whose file was changed since the last time it was indexed there.

Takes no arguments or options. Elements become eligible for reindexing as a side effect of
uploading, replacing, or deleting a file - the affected element is queued internally, and this
command drains that queue, re-merging each element so all three backing stores (Cypher, MongoDB,
Elasticsearch) agree on its `file`/`hasFile` properties again. An element that was deleted in the
meantime before being reindexed is skipped, since there is nothing left to sync.

> **⚠ Note**
>
> Normally run as part of [`cron`](/command/cron.md), not invoked directly.

## Help

```bash
php bin/console cron:reindex-files --help
```

```text
Description:
  Updates element files within Elasticsearch. Restricted to files marked as updated.

Usage:
  cron:reindex-files

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "prod"]
      --no-debug        Switch off debug mode.
      --profile         Enables profiling (requires debug).
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```

## Example

```bash
php bin/console cron:reindex-files
```

```text
    ▄
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   v0.1.31, production mode

  Cron

  Reindexing files marked as updated...

▶ Reindexed 0 element file(s).
```

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [cron:delete-expired-uploads](/command/cron-delete-expired-uploads.md)

Next: [database:drop](/command/database-drop.md)
