Integration with P4 Search

P4 Search, powered by Elasticsearch, enhances search capabilities across various Perforce products. It indexes versioned file content, meta data, revision details, and change descriptions within P4. P4 Search provides more comprehensive search criteria and reduces the search load on the P4 Server itself.

Set up the P4 Search integration

For details on how to set up the P4 Search integration, see P4 Search integration property in the P4 Server Administration Documentation.

Here are example p4 property commands you can use:

  • Setting the global P4 Search URL:

    p4 property -a -n P4.P4Search.URL -v https://localhost:1601

    where https://localhost:1601 is the URL of your P4 Search instance.

  • Enabling P4 Search for a specific user (for example, username):

    p4 property -a -u username -n P4.P4Search.URL -v https://localhost:1601
  • Enabling P4 Search for a specific group (for example, group):

    p4 property -a -g group -n P4.P4Search.URL -v https://localhost:1601

P4 Search integration features

Once P4 Search is integrated, a P4 Search toggle displays in the Submitted changelist tab. This allows you to efficiently search your P4 Server using the enhanced capabilities of P4 Search.

To perform searches using the P4 Search toggle, follow these steps:

  1. Select one of the following search categories:

    • Change: Specify a range of changelists. For example, 10223 and 10230.

    • Date: Specify a submitted files date range. For example, 29 April 2025 13:16:09 and 06 May 2025 13:16:09.

    • Files: Specify the depot path that you want to perform the search on. If you have special characters in your depot path, then you can use double quotes. For example, //depot/main/* or "//depot/-200/main/*".

    • Description: Search within changelist descriptions.

      P4 Search indexes text by identifying all words and storing them as "query phrase". Query phrase is a sequence of words separated by spaces. The final word in each query phrase is treated as a prefix. For example, the query phrase "foo ba" will match words like "foo bar" and "foo baz".

      Query phrases can be specified as lists of words separated by spaces. For example, "foo ba".

      Multiple query phrases can be included in the field by separating them with commas. For example, "job,bug report"

    • User: Specify a user name. For example, "xyz".

  2. Select one of the following boolean queries:

    • must match: Returns results that contains all specified terms exactly.

      When a must match query is used, all queries must be present in the matching documents for them to be returned as results. This functions like an "AND" operator, ensuring that every condition is satisfied.

    • should match: Returns results that contain at least one of the specified terms.

      When a should match query is used, any matched document, will increase the relevance score of the document. However, it is not necessary for documents to match all of the "should" query in order to be included in the results. This functions like an "OR" operator, meaning that matching any of the queries is enough for a document to be considered.

    • must not match: Excludes results that contain the specified term.

    For the "Description" search category, select one of the following options from the drop-down:

    • includes any of the phrases: If even one of your query phrase matches part of the description, it is included in the search result. For example, if your query phrase is "foo ba" then the results will match with the description "This is a foo bar task", "The issue was foo baz".

    • includes all of the phrases: A description must match every query phrase you specify which means not just one, but all of them. For example, if your query phrase is "foo ba, bug rep" then the results returned will match with the description "We received a bug report related to the foo bar feature." but it will not match with the description "This is a foo bar issue.".

    • does not include any of the phrases: A description will be included only if it matches none of the specified query phrases. If even one query phrase matches, the description is excluded from the results. For example, if your query phrase is "foo ba, bug rep" then the results returned will match with the description "The feature is live in production." but it will not match with the description "This task is a bug report." or "This is a foo bar related bug report.".

  3. Enter your specific search criteria and select Enter.

  4. Select Add more search criteria to add more search criteria and select Remove search criteria to delete one or more of the search criteria.

You can save your search filters and reuse them, you can also manage your saved filters. To learn more, see Save and reuse filters.