Configure services used by Helix Search
This section describes configuration of the Helix Search, Helix Core server, and Elasticsearch services.
Helix Search can also be configured using the Helix Search web page, see Configuring Helix Search services.
Check the Helix Search status
To check the status of your Helix Search service, navigate to the status page using the connection details you set for the Helix Search service during the installation.
For example:
http://myhelixsearch.mydomain.com:1601/p4search/settings/status
By default, the web page requires you to log in with your Helix server credentials. To disable this change the following property to false:
com.perforce.p4search.security.required=false
The Helix Search web status page displays a yellow warning for Service Security when security is disabled.
Configure the Helix Search service
This section details configuration of the Helix Search service including connection to external services such as, Helix server and Elasticsearch.
You can either edit the etc/config.properties file or use the web page.
For first time setup using the web page, or if your Helix server connection fails, edit the etc/config.properties file to change the com.perforce.p4search.security.required=true value to false. Save the file and restart the Helix Search service.
You must reset this back to true when you have finished configuring the Helix Search service.
To view and change the configuration of your Helix Search service, navigate to the configuration page (/settings/configure) using the connection details you set for the Helix Search service during the installation. If credentials are requested, provide Helix server credentials that are admin or greater.
For example:
http://myhelixsearch.mydomain.com:1601/p4search/settings/configure
Configure product and version
Helix Search has a product name and version configuration which is used in the Helix server log.
Default configuration:
com.perforce.p4search.product=p4search Product name visible in the Helix server log
com.perforce.p4search.version=0.1 Product version visible in the Helix serverlog
For example:
If you have multiple instances of Helix Search, we recommend that you append the product name to help distinguish between the log entries. For example:
com.perforce.p4search.product=p4search-1
com.perforce.p4search.product=p4search-2
Configure the web service
By default, the Helix Search web service is public to machines on the same network.
Default configuration:
com.perforce.p4search.protocol=http
com.perforce.p4search.host=0.0.0.0
com.perforce.p4search.port=1601
com.perforce.p4search.secure.keystore= see SSL security for Helix Search
com.perforce.p4search.secure.keypass= see SSL security for Helix Search
You can configure the Helix Search web service to use HTTPS, see SSL security for Helix Search.
Configure Helix server
The Helix server connection requires a P4PORT, a Perforce Standard User and a ticket (this is for the search service user). The search service user is used to index changes and files. To index file content this user must have 'read' access to the files.
Default configuration:
com.perforce.p4search.setup.retry=30000
com.perforce.p4search.p4port=localhost:4000
com.perforce.p4search.p4trust=
com.perforce.p4search.service.p4user=super
com.perforce.p4search.service.p4ticket=AEEB1208CB06479B022D97C2784EEFDA
com.perforce.p4search.anonymous.p4user=anonymous
com.perforce.p4search.anonymous.p4ticket=
To print out a standard Perforce user ticket for the search service user that is valid for all hosts, run the following command and add the value to your config properties file:
p4 -p <p4port> -u <p4user> login -a -p
For example:
com.perforce.p4search.p4port=perforce.com:1666 com.perforce.p4search.service.p4user=service com.perforce.p4search.service.p4ticket=FFEEDDCCBBAA99887766554433221100
For an ssl enabled Helix server
If your Helix server is SSL enabled, add the ssl protocol to the p4port field and provide the trusted fingerprint in the p4trust field:
com.perforce.p4search.p4port=ssl:perforce.com:1666 com.perforce.p4search.p4trust=59:75:62:6C:4F:C9:53:F5:4A:30:90:FF:C9:60:01:10:C7:D0:ED:1F
Anonymous user
Optional: an anonymous user can be provided for the unsupported search web pages. The anonymous user needs read permission in the Helix server for the areas of the depot you want to allow search result access to. Leaving the anonymous user and ticket values empty disables anonymous access:
com.perforce.p4search.anonymous.p4user= com.perforce.p4search.anonymous.p4ticket=
If you are using Helix Search with another service such as Swarm and are using Helix server security level 5 and above, provide a list of trusted IP addresses for the services.
For example:
com.perforce.p4search.trusted.ips=swarm.perforce.com,proxy.perforce.com
Set Cross-Origin Resource Sharing (CORS)
Specify an origin for the browser to allow resource access, default is empty.
com.perforce.p4search.access-control-allow-origin=
Set the retry interval
The retry interval when locating Elasticsearch and Perforce Services, defaults to 30000 milliseconds..
com.perforce.p4search.setup.retry=30000
Configure the Index
Helix Search indexes Helix server data when called with the REST API, see Index endpoints.
The following configuration options determine the behavior of the indexer.
Set the index token
The index token, defaults to 00000000-0000-0000-0000-000000000000.
com.perforce.p4search.index.token=00000000-0000-0000-0000-000000000000
Set the maximum threads used for indexing
The number of threads Helix Search uses when indexing Helix server changelists, defaults to 32 threads.
com.perforce.p4search.index.pool=32
Set the maximum size of files that are indexed
The max file size (in bytes) Helix Search will try and index it's content, defaults to 10MB
com.perforce.p4search.maxfilesize=104857600
Set the Helix Search timeout
The timeout used by Helix Search, defaults to 20000 milliseconds.
com.perforce.p4search.timeout=20000
Set the maximum number of changes per single bulk request
The number of changes in a single bulk request to Elasticsearch, defaults to 1000 changes.
com.perforce.p4search.bulksize=1000
Set the trusted IP addresses for Helix Search
A comma separated list of IP addresses that are trusted by Helix Search.
com.perforce.p4search.trusted.ips=
Configure results for user queries
User query results can be filtered by Helix Search. The following configuration options determine the behavior of the Helix Search filtering.
Filter search results for restricted changelists
To filter restricted changelists set the restricted field to true (this is the default and is recommended).
com.perforce.p4search.restricted=true
Filter search results by Helix server user permissions
To filter user search results based on their Helix server permissions (output of the p4 protect command), set the permission.required field to true. This requires the installation of the Helix server p4search-filter plugin for Elasticsearch, see the Elasticsearch plugin documentation. Default is true.
com.perforce.p4search.permission.required=true
Use of the Helix server p4search-filter plugin will introduce a small overhead in the query time. This is mainly determined by the number of protection entries that are applied to the user running the query. In some situations you might want to disable the filter if Helix Search only contains indexed data that is visible to all users.
Configure Elasticsearch
For more information on the Elasticsearch plugin, see the Elasticsearch plugin documentation.
Default configuration:
com.perforce.p4search.elastic.hosts=http://localhost:9200
com.perforce.p4search.index=perforce1
com.perforce.p4search.elastic.user=
com.perforce.p4search.elastic.pass=
com.perforce.p4search.elastic.tracktotalhits=10000
com.perforce.p4search.index.tags=tags,thumb
com.perforce.p4search.bulksize=1000
Configure Elasticsearch hosts
- Provide the configuration with a comma separated list of Elasticsearch hosts, for example:
- Helix Search needs access to Elasticsearch to create and update a single index for the Helix server data. The name of the index is configured using:
com.perforce.p4search.elastic.hosts=http://localhost:9200,http://localhost:9201
com.perforce.p4search.index=perforce1
If you are using multiple instances of Helix Search ensure that you use a different index name for each instance.
Elasticsearch authentication
If your Elasticsearch instance requires authentication, add to the following empty fields to the configuration, default.
com.perforce.p4search.elastic.user= com.perforce.p4search.elastic.pass=
Performance tuning
To tune performance:
-
Set a limit to the number of results processed by a single query, default is 10000.
-
Set the Maximum ElasticSearch batch size used when indexing data, default is 1000.
com.perforce.p4search.elastic.tracktotalhits=10000
com.perforce.p4search.bulksize=1000
Set the index tags
Set the index tags as a comma separated list, default is tags,thumb.
com.perforce.p4search.index.tags=tags,thumb