Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 Search Documentation | 2025.5

# Index P4 Server for the first time

You can index P4 Server for the first time from the web UI or from the command line.

How much of your server you decide to index will depend on the size of your deployment. For a small site, you might want to index everything, but for a larger site, you might only want to index a project. For typical index throughput, see Index throughput.

For optimal performance, Elasticsearch recommends an index size of 50 GB. To align with this best practice, P4 Search automatically creates a partitioned index once the index reaches 50 GB. This behavior is defined in the policy.json file.

## Index P4 Server from the web UI

See Index P4 Server from the web UI.

## Index P4 Server from the command line

### Index a small site deployment

To index all of the changes in your depot, use the following curl request:

curl -H X-Auth-Token: <X-AUTH-TOKEN> -X POST http://localhost:1601/api/v1.2/index/changes

To learn more about the fields that can be used to limit a request, see the Index endpoints in the Swagger P4 Search REST API.

To learn more about small site deployments, see Small site deployments.

### Index a medium site deployment

To index all changes in separate parts of your depot, run the curl request only on the parts of the depot you need to.

For example, if you had project A, project B, and project C, but you only wanted to index project A and project B, you could use the following requests:

Project A:

curl -H X-Auth-Token: <X-AUTH-TOKEN> -X POST -d '{"depotFile":"//projA/..."}' http://projA.perforce.com:1601/api/v1.2/index/changes

Project B

curl -H X-Auth-Token: <X-AUTH-TOKEN> -X POST -d '{"depotFile":"//projB/..."}' http://projB.perforce.com:1601/api/v1.2/index/changes

To learn more about the fields that can be used to limit a request, see the Index endpoints in the Swagger P4 Search REST API.

To learn more about medium site deployments, see Medium site deployments.

## Related topics

- Index P4 Server from the web UI.

Your search for returned results