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

P4 Search Documentation | 2025.6

# Connect P4 Search to P4 Code Review

You can connect P4 Search to P4 Code Review to extend standard P4 Code Review searches, enabling them to search file content and changelist descriptions by using the P4 Search API.

- If you make a configuration change, P4 Code Review will not use it until the P4 Code Review config cache is deleted. To learn more, see P4 Code Review config cache file delete.
- To learn more about configuring P4 Code Review, see Configuration overview in the P4 Code Review Documentation.

Configure P4 Code Review search to use your P4 Search service with the following configuration block in the `SWARM_ROOT/data/config.php` file:

    <?php
        // this block should be a peer of 'p4'
        'search' => array(
            'p4_search_host'  => 'http://myp4search.mydomain.com:1601', // optional URL to P4 Search host
            'maxlocktime'     => 5000, // 5 seconds, in milliseconds
        ),

## p4_search_host

The `p4_search_host` configurable specifies the URL of your P4 Search server. When configured, P4 Code Review issues API calls to P4 Search to take advantage of its file content and description indexing.

## maxlocktime

The `maxlocktime` key specifies the maximum amount of time, in milliseconds, that any table within the P4 Server should be locked while performing `fstat` command searching. Increasing this value might allow better search results at the expense of potentially blocking other queries on the P4 Server. Decreasing this value impacts the P4 Server less, but may be insufficient for returning the desired search results.

## Comment attachment thumbnail/preview and blur generation

P4 Code Review generates the blur and thumbnail/preview images for P4 Code Review comment attachments and stores them in the comment attachment depot.

To prevent P4 Code Review clashing with P4 Search thumbnail/preview and blur generation, set the P4 Server protections for the P4 Code Review comment attachments depot directory so only the swarm user has access to it.

P4 Code Review 2022.1 Patch 1 and later: By default, the P4 Code Review package and OVA post-installation configuration script offers to create the comment attachment depot directory as //.swarm and set the protections so only the swarm user has access to it.

For example, if the comment attachment depot directory is //.swarm, set P4 Server protections for //.swarm to:

list user * * -//.swarm/...

admin user swarm * //.swarm/...

super user super * //.swarm/...

This prevents P4 Search creating thumbnails/previews and blurs for files stored in the comment attachment depot directory.

### Related topics

- To learn more about configuring the P4 Code Review comment attachments depot directory, see Comment attachments.

- To learn more about setting P4 Server protections, see the Setting protections with p4 protect section of the P4 Server Administration Documentation.

Your search for returned results