If you install Alfresco using the setup wizard, Solr is installed and enabled automatically. Solr is installed in the same Tomcat container as Alfresco, and the connection URL is unchanged from the default. The Solr home is in the Alfresco data directory, which also contains the Solr data files.
If you have an existing Alfresco installation, and you wish to configure it to use Solr search, you need to apply the Solr archive to your web application.
For Alfresco One 4.2 and 4.2.1, the Solr server is supported only when running in a Tomcat application server. From Alfresco One 4.2.2 onwards, Solr server is supported on JBoss as well.
This file contains the following artifacts:
The following instructions use <ALFRESCO_TOMCAT_HOME> to refer to the tomcat directory where Alfresco is installed and <SOLR_TOMCAT_HOME> to the tomcat directory where Solr is installed. These may be the same or different directories, depending on whether you have chosen to install Solr on a standalone server.
For example:
<?xml version="1.0" encoding="utf-8"?> <Context docBase="<SOLR-ARCHIVE>\apache-solr-1.4.1.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="<SOLR-ARCHIVE>" override="true"/> </Context>
Set the data.dir.root property to the location where the Solr indexes will be stored. You can set the same value for the both cores, and the cores will create the sub-directories.
For Unix use:
mkdir -p <ALFRESCO_HOME>/alf_data/keystore cp <ALFRESCO_TOMCAT_HOME>/webapps/alfresco/WEB-INF/classes/alfresco/keystore/* <ALFRESCO_HOME>/alf_data/keystore
For Windows use:
mkdir <ALFRESCO_HOME>\alf_data\keystore copy <ALFRESCO_TOMCAT_HOME>\webapps\alfresco\WEB-INF\classes\alfresco\keystore\* <ALFRESCO_HOME>\alf_data\keystore
For example:
<Connector port="8443" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" keystoreFile="/opt/alfresco/keystore/ssl.keystore" keystorePass="kT9X6oe68t" keystoreType="JCEKS" secure="true" connectionTimeout="240000" truststoreFile="/opt/alfresco/keystore/ssl.truststore" truststorePass="kT9X6oe68t" truststoreType="JCEKS" clientAuth="want" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" maxHttpHeaderSize="32768" />
For example:
dir.keystore=<SOLR_ARCHIVE>/alf_data/keystore
For example:
<user username="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repository" password="null"/>
For example:
<user username="CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repoclient" password="null"/>
If you are applying these instructions to a clustered installation, the steps should be carried out on a single host and then the generated .keystore and .truststore files must be replicated across all other hosts in the cluster.
You should see the message Certificate update complete and another message reminding you what dir.keystore should be set to in the alfresco-global.properties file.
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
Configuration File | Location | Description |
---|---|---|
repository.properties | alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\ | This file specifies the Solr-related properties in how Alfresco connects to the Solr server. As the Solr server runs in the same Tomcat instance as Alfresco, the connection properties are setup to connect to a locally running Solr server. |
schema.xml | alfresco\alf_data\solr\<core>, where <core> is the location of core's configuration directory, for example alfresco\alf_data\solr\workspace-SpacesStore\conf or alfresco\alf_data\solr\archive-SpacesStore\conf | This file defines the schema for the index including field type definitions with associated analyzers. It contains details about the fields that you can include in your document and also describes how those fields can be used when adding documents to the index or when querying those fields. |
solr.xml | alfresco\tomcat\conf\catalina\localhost\ | This file defines the Solr web application context. It specifies the location of the Solr war file and sets up the Solr home directory. |
solr.xml | alfresco\alf_data\solr | This file specifies the cores to be used by Solr. |
solrconfig.xml | alfresco\alf_data\solr\workspace-SpacesStore\conf or alfresco\alf_data\solr\archive-SpacesStore\conf | This file specifies the parameters for configuring Solr. Also, the Solr search components are added to this file. |
solrcore.properties | alfresco\alf_data\solr\workspace-SpacesStore\conf or alfresco\alf_data\solr\archive-SpacesStore\conf | This is the property configuration file for a core. Solr supports system property substitution, so properties that need substitution can be put in to this file. There is one solrcore.properties file in each core's configuration directory. For details, see the Solr core configuration properties [16] topic. |
context.xml | alfresco\alf_data\solr | This file specifies the Solr web application context template to use when installing Solr in separate tomcat server. |
ssl.repo.client.keystore | alfresco\alf_data\solr\workspace-SpacesStore\conf or alfresco\alf_data\solr\archive-SpacesStore\conf | This keystore contains the Solr public/private RSA key pair. |
ssl-keystore-passwords.properties | alfresco\alf_data\solr\workspace-SpacesStore\conf or alfresco\alf_data\solr\archive-SpacesStore\conf | This file contains the password information for ssl.repo.client.keystore. |
ssl.repo.client.truststore | alfresco\alf_data\solr\workspace-SpacesStore\conf or alfresco\alf_data\solr\archive-SpacesStore\conf | This keystore contains the trusted Alfresco Certificate Authority certificate (which has been used to sign both the repository and Solr certificates) |
ssl-truststore-passwords.properties | alfresco\alf_data\solr\workspace-SpacesStore\conf or alfresco\alf_data\solr\archive-SpacesStore\conf | This file contains the password information for ssl.repo.client.truststore. |
Property Name | Description | Default Value |
---|---|---|
data.dir.root | This property specifies the top level directory path for the indexes managed by Solr. | C:/Alfresco/alf_data/solr |
data.dir.store | This property specifies the directory relative to data.dir.root where the data for this core is stored. | workspace/SpacesStore |
enable.alfresco.tracking | This property instructs Solr if it should index Alfresco content in the associated Alfresco repository store or not. | true |
cache.alfresco.size | This property specifies the Alfresco cache size used internally for PATH looks up. | 100 |
max.field.length | This property specifies the maximum number of tokens to include for each field. By default, all tokens are added. | 2147483647 |
alfresco.host | This property specifies the host name for the Alfresco instance that Solr should track and index. In a default installation, both Alfresco and Solr runs in the same Tomcat instance and on the same host, so host would be set to local host. | localhost |
alfresco.port | This property specifies the HTTP port for the Alfresco instance that Solr should track and index. | 8080 |
alfresco.port.ssl | This property specifies the HTTPS port for the Alfresco instance that Solr should track and index. | 8443 |
alfresco.cron | This property specifies the cron expression that instructs Solr how often to track Alfresco and index new or updated content. The default value indicates that Solr tracks Alfresco every 15 seconds. | 0/15 * * * * ? * |
alfresco.stores | This property specifies the Alfresco repository store that this core should index. | workspace://SpacesStore |
alfresco.baseUrl | This property configures the base URL to Alfresco web project. | /alfresco |
alfresco.lag | When Solr tracking starts, it aims to get up to date to the current time (in seconds), less this lag. | 1000 |
alfresco.hole.retention | Each track will revisit all transactions from the timestamp of the last in the index, less this value, to fill in any transactions that may have been missed. | 3600000 |
alfresco.batch.count | This property indicates the number of updates that should be made to this core before a commit is executed. | 1000 |
alfresco.secureComms | This property instructs Solr if it should talk to Alfresco over HTTP or HTTPS. Set to none if a plain HTTP connection should be used. | https |
alfresco.encryption.ssl.keystore.type | This property specifies the CLIENT keystore type. | JCEKS |
alfresco.encryption.ssl.keystore.provider | This property specifies the Java provider that implements the type attribute (for example, JCEKS type). The provider can be left unspecified and the first provider that implements the keystore type specified is used. | |
alfresco.encryption.ssl.keystore.location | This property specifies the CLIENT keystore location reference. If the keystore is file-based, the location can reference any path in the file system of the node where the keystore is located. | ssl.repo.client.keystore |
alfresco.encryption.ssl.keystore.passwordFileLocation | This property specifies the location of the file containing the password that is used to access the CLIENT keystore, also the default that is used to store keys within the keystore. | ssl-keystore-passwords.properties |
alfresco.encryption.ssl.truststore.type | This property specifies the CLIENT truststore type. | JCEKS |
alfresco.encryption.ssl.truststore.provider | This property specifies the Java provider that implements the type attribute (for example, JCEKS type). The provider can be left unspecified and the first provider that implements the truststore type specified is used. | |
alfresco.encryption.ssl.truststore.location | This property specifies the CLIENT truststore location reference. If the truststore is file-based, the location can reference any path in the file system of the node where the truststore is located. | ssl.repo.client.truststore |
alfresco.encryption.ssl.truststore.passwordFileLocation | This property specifies the location of the file containing the password that is used to access the CLIENT truststore, also the default that is used to store keys within the truststore. | ssl-truststore-passwords.properties |
alfresco.enableMultiThreadedTracking | This property enables/disables multi-threaded tracking. | true |
alfresco.corePoolSize | This property specifies the pool size for multi-threaded tracking. It is used for indexing nodes. | 3 |
alfresco.maximumPoolSize | This property specifies the maximum pool size for multi-threaded tracking. | -1 |
alfresco.keepAliveTime | This property specifies the time (in seconds) to keep non-core idle threads in the pool. | 120 |
alfresco.threadPriority | This property specifies the priority that all threads must have on the scale of 1 to 10, where 1 has the lowest priority and 10 has the highest priority. | 5 |
alfresco.threadDaemon | This property sets whether the threads run as daemon threads or not. If set to false, shut down is blocked else it is left unblocked. | true |
alfresco.workQueueSize | This property specifies the maximum number of queued work instances to keep before blocking against further adds. | -1 |
alfresco.maxTotalConnections | This property is used for HTTP client configuration. | 40 |
alfresco.maxHostConnections | This property is used for HTTP client configuration. | 40 |
solr.filterCache.size | This property specifies the maximum number of entries in the Solr filter cache. | 512 |
solr.filterCache.initialSize | This property specifies the initial capacity (number of entries) of the Solr filter cache. | 512 |
solr.queryResultCache.size | This property configures the Solr result cache. | 1024 |
solr.queryResultCache.initialSize | This property configures the Solr result cache. | 1024 |
solr.documentCache.size | This property configures the Solr document cache. | 512 |
solr.documentCache.initialSize | This property configures the Solr document cache. | 512 |
solr.queryResultMaxDocsCached | This property configures the Solr result cache. | 200 |
solr.maxBooleanClauses | This property specifies the number of Boolean clauses in a query. It can affect range or wildcard queries that expand to big Boolean queries. | 10000 |
alfresco.transactionDocsBatchSize | This property is used for batch fetching updates during tracking. | 100 |
alfresco.changeSetAclsBatchSize | This property is used for batch fetching updates during tracking. | 100 |
alfresco.aclBatchSize | This property is used for batch fetching updates during tracking. | 10 |
solr.query.maximumResultsFromUnlimitedQuery | This property is used to set the maximum number of results returned by Solr
queries, therefore, limiting otherwise unconstrained Solr queries to return a finite
number of results. This prevents such unconstrained queries from consuming excessive
resources. By default, the value is set to the same value as the
system.acl.maxPermissionChecks property. Note:
|
1000 |
alfresco.index.transformContent | If this property is set to false, the index tracker will not transform any content and only the metadata will be indexed. | false |
### Solr indexing ### index.subsystem.name=solr dir.keystore=${dir.root}/keystore solr.port.ssl=8443
Property | Description |
---|---|
index.subsystem.name | The subsystem type value. The index.subsystem.name property values are either solr or lucene. |
solr.host | The host name where the Solr instance is located. |
solr.port | The port number on which the Solr instance is running. |
solr.port.ssl | The port number on which the Solr SSL support is running. |
For example, some example properties for activating Solr are:
index.subsystem.name=solr solr.host=localhost solr.port=8080 solr.port.ssl=8443
Property | Description |
---|---|
index.subsystem.name | Select the subsystem type value as either solr or lucene. |
solr.host | The host name where the Solr instance is located. |
solr.port | The port number on which the Solr instance is running. |
solr.port.ssl | The port number on which the Solr SSL support is running. |
The subsystems have their own related properties. The managed - solr instance exposes the solr.base.url property. The lucene subsystem exposes all the properties that had to be set at start up.
Alfresco 4 with Solr subsystem, does not to include any transactional indexing operation. In other words, Alfresco 4 removes the requirement to have the database and indexes in perfect sync at any given time and relies on an index that gets updated on a configurable interval (default: 15s) by Solr itself.
The index tracker will take care of polling Alfresco for new transactions and will proceed to update its index. In this sense, indexes will eventually be consistent with the database.
You may see a message on the Tomcat console similar to the following (and may find that Solr search and/or the Solr tracking is not working):
Aug 22, 2011 8:19:21 PM org.apache.tomcat.util.net.jsse.JSSESupport handShake WARNING: SSL server initiated renegotiation is disabled, closing connection
This message indicates that one side of the SSL connection is trying to renegotiate the SSL connection. This form of negotiation was found to be susceptible to man-in-the-middle attacks and it was disabled in the Java JSEE stack until a fix could be applied.
Refer to the following link for more information: http://www.oracle.com/technetwork/java/javase/documentation/tlsreadme2-176330.html [19].
Refer also to the following links: http://www.gremwell.com/enabling_ssl_tls_renegotiation_in_java [20] o http://tomcat.apache.org/tomcat-6.0-doc/config/http.html [21].
If your version of Java does not have the fix, you need to re-enabled renegotiation by performing the following steps:
Links:
[1] https://docs.alfresco.com/../tasks/solr-install-config.html
[2] https://docs.alfresco.com/../tasks/generate-keys-solr.html
[3] https://docs.alfresco.com/../concepts/solr-directory.html
[4] https://docs.alfresco.com/../concepts/solr-config-files.html
[5] https://docs.alfresco.com/../concepts/solr-subsystem.html
[6] https://docs.alfresco.com/../tasks/solr-alfresco-config.html
[7] https://docs.alfresco.com/../concepts/solr-event-consistency.html
[8] https://docs.alfresco.com/../concepts/solr-troubleshooting.html
[9] https://docs.alfresco.com/../concepts/solr-home.html
[10] http://www.alfresco.com/services/subscription/supported-platforms
[11] https://docs.alfresco.com/generate-keys-solr.html
[12] https://docs.alfresco.com/../concepts/solr-webapp-config.html
[13] https://docs.alfresco.com/solr-install-config.html
[14] https://support.alfresco.com
[15] https://docs.alfresco.com/solr-config-files.html
[16] https://docs.alfresco.com/solrcore-properties-file.html
[17] https://docs.alfresco.com/../concepts/solrcore-properties-file.html
[18] https://docs.alfresco.com/../tasks/controlling_search_results.html
[19] http://www.oracle.com/technetwork/java/javase/documentation/tlsreadme2-176330.html
[20] http://www.gremwell.com/enabling_ssl_tls_renegotiation_in_java
[21] http://tomcat.apache.org/tomcat-6.0-doc/config/http.html