Perforce Public Knowledge Base - P4Search Log Files and Troubleshooting Search Problems
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



P4Search Log Files and Troubleshooting Search Problems

« Go Back


How can I determine if the P4Search application is processing files? 

My search doesn't find any files - why?

This document applies to P4Search 2014.1.
This document assumes you've deployed P4Search as packaged from our download site and start the p4search process by running:
cd <p4search-install>

P4Search Web App

This app controls indexing the files and front-ends all searches.  The searches can be run from the P4Search Web UI or from Commons. The log file can be found in:

To confirm files are being indexed, increase the logging by editing <p4search-install>/install/jetty-distrib*/resource/ and adding:

You must restart the p4search web app to pick up changes.

Sample log for a submit of file //depot/devxml/src/README:
259733 [Thread-15] DEBUG - Adding //depot/devxml/src/README 
259733 [Thread-18] INFO com.perforce.p4java.extension.server.internal.ServerConnectionPool - creating a new connecting to the server... 
259764 [Thread-18] DEBUG - indexing //depot/devxml/src/README 
260213 [Thread-18] DEBUG - done with //depot/devxml/src/README

To see the files found in a search, add this to
You should now see the output listing the files found when search for pickles:
46248 [qtp779597446-16] DEBUG - Searching for: {!boost b=recip(ms(NOW,modifiedtime),3.16e-11,1,1)}((filename:pickles OR filename:*pickles*) OR ("pickles"~100)) AND (headrevision:true) 
46371 [qtp779597446-16] DEBUG com.perforce.p4java.extension.server.internal.ServerImpl - EXEC >>> p4 files //depot/devxml/src/README //depot/dev/src/file.bin //depot/main/src/file.bin
For this example, the search found three files in the solr index.  If the command was simply "p4 files" then no files were found.

Solr Web App

This is a packaging of Apache Solr (, configured with a schema to handle Perforce files and meta data.
Log file:  <p4search-install>/install/logs/solr.log

To check for which files are indexed, search the log for "{add=[//"

$ grep "\{add=\[//" solr.log 
INFO - 2015-04-02 10:17:07.444; org.apache.solr.update.processor.LogUpdateProcessor; [collection1] 
webapp=/solr path=/update/extract params={literal.filename=README
{add=[//depot/devxml/src/README (1497361313861468160)]} 0 652

My Search Fails to Find Files

You know the file should be found but your search results does not return the file.

Use the above logging to determine the file was found in solr.  There are typically two reasons why search values aren't found with the P4Search UI or Commons but are found in solr:
  1. the ticket to the Perforce Server isn't valid.    This is likely to only to occur when searching through Commons.
  2. the user does not have permission to access the file
For 1, first check the p4search log for errors related to accessing the Perforce Server.   See the below section on Commons Search Never Returns Results.

For 2, make sure your contains:
And that you have restarted the p4search web app after changing

Sample log output when search for "pickles":
46248 [qtp779597446-16] DEBUG
- Searching for: {!boost b=recip(ms(NOW,modifiedtime),3.16e-11,1,1)}
((filename:pickles OR filename:*pickles*) OR ("pickles"~100)) AND (headrevision:true)

46371 [qtp779597446-16] DEBUG com.perforce.p4java.extension.server.internal.ServerImpl  
- EXEC >>> p4 files //depot/devxml/src/README //depot/dev/src/file.bin //depot/main/src/file.bin

As a super user, repeat the "p4 files" command while impersonating the user running the query:
$ p4 login testuser
 User testuser logged in. 

$ p4 -u testuser files //depot/devxml/src/README //depot/dev/src/file.bin //depot/main/src/file.bin 
//depot/devxml/src/README - protected namespace - access denied. 
//depot/dev/src/file.bin#3 - edit change 81 (binary) 
//depot/main/src/file.bin#1 - add change 77 (binary)
The above would explain why README is not returned in your search results

Commons Search Never Returns Results

Check the p4search log file.  If you see errors related to login for the user running the search verify the commons.config file property com.perforce.commons.config.externalSearchIP is the IP address of the machine running p4search.   Use only if the Perforce server is on the exact same machine.

Using the Solr Admin Console

Solr ships with an admin console that you can use to run queries against your P4Search DB. By default this runs on port '127.0.01:8993' of the P4Search machine and the query URL is (must run on the P4Search machine):


Queries appear in the 'solr.log' (as mentioned above) and can be tested directly in the interface. For example when searching for the text 'f1' the following log entry is seen:
INFO  - 2016-03-10 16:39:51.705; org.apache.solr.core.SolrCore; [collection1] webapp=/solr 
path=/select params={fl=id,score,modifiedby&start=0&q={!boost+b%3Drecip(ms(NOW,modifiedtime),3.16e-11,1,1)}
&wt=javabin&collectionName=collection1&version=2&rows=10} hits=4 status=0 QTime=56

This can be input as the following query using Solr admin:

Solr Admin Example

Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255