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

# content:backfill-indexed-content

> Backfill indexed_content and source_file_id for HTML files uploaded before search indexing existed

Repairs the two columns search reads for "Upload HTML" content: a File's extracted `indexed_content` and the
`source_file_id` reverse index that lets a Page embedding that File be found by the File's text.

A clean upgrade needs nothing from this command -- both columns are backfilled once by the migrations that
introduce them. Run it instead when that one-shot backfill could not have covered every row, for example:

* A prior migration run partially failed on an unreadable attachment.
* Content was restored from a backup taken before the columns existed.
* Rows need to be re-derived after the text-extraction logic itself changes.

The command is safe to run repeatedly: each step only writes a row whose current value disagrees with what a
fresh save would produce, so a second run reports nothing changed.

**Options:**

| Option      | Shortcut | Description                                              |
| ----------- | -------- | -------------------------------------------------------- |
| `--dry-run` |          | Report what would be backfilled without writing anything |

**Examples:**

```bash theme={null}
# Backfill both columns
php artisan content:backfill-indexed-content

# Report what would be backfilled without writing anything
php artisan content:backfill-indexed-content --dry-run
```

Example output from a dry run against an installation with one "Upload HTML" page whose columns had been
cleared:

```text theme={null}
Dry run -- no changes will be written.
Scanned 7 HTML file(s); 2 without indexed content.
Scanned 15 page(s); 1 would be updated.
Backfill complete. Trigger a search reindex (POST /portal/reindexSearch) to sync external search engines with
the backfilled content.
```

After a real run, trigger a search reindex (`POST /portal/reindexSearch`) so external search engines pick up
the backfilled content.
