An Apache Solr installation may be shared between the node store (Oak) and common store (SRP) by using different collections.
If both the Oak and SRP collections are used intensively, a second Solr may be installed for performance reasons.
For production environments, SolrCloud mode provides improved performance over standalone mode (a single, local Solr setup).
Download and install Apache Solr:
Solr requires Java™ 1.7 or greater
No service is needed
Choice of run modes:
Choice of Multilingual Search (MLS)
SolrCloud mode is recommended for production environments. When running in SolrCloud mode, SolrCloud must be installed and configured before installing Multilingual Search (MLS).
The recommendation is to follow the SolrCloud instructions to install:
It is also recommended to configure JVM to tune memory usage and garbage collection.
JVM_OPTS="-server -Xmx2048m -XX:MaxPermSize=768M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xloggc:../logs/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Djava.awt.headless=true"
When running in SolrCloud mode, before MLS installation, use, and knowledge of the following SolrCloud set-up commands is necessary.
Reference:
https://solr.apache.org/guide/6_6/command-line-utilities.html
Usage:
sh ./scripts/cloud-scripts/zkcli.sh
-cmd upconfig
-zkhost server:port
-confname *myconfig-name *
-solrhome solr-home-path
-confdir config-dir
Usage:
./bin/solr create
-c mycollection-name
-d config-dir
-n myconfig-name
-p port
-s number-of-shards
-rf number-of-replicas
Link a collection to a configuration already uploaded to ZooKeeper.
Reference:
https://solr.apache.org/guide/6_6/command-line-utilities.html
Usage:
sh ./scripts/cloud-scripts/zkcli.sh
-cmd linkconfig
-zkhost server:port
-collection mycollection-name
-confname myconfig-name
Multilingual Search (MLS) for AEM Communities is built for the Solr platform to provide improved search across all supported languages, including English.
MLS for AEM Communities is available as either Standard MLS or Advanced MLS. Standard MLS only includes Solr configuration settings, and excludes any plugins or resource files. Advanced MLS is the more comprehensive solution and includes Solr configuration settings and plug-ins and related resources
Standard MLS includes enhancements for content search for the following languages:
Advanced MLS includes enhancements for content search for the following languages:
In all, the following 33 languages are supported in Advanced MLS.
Arabic | German | Norwegian |
---|---|---|
Bulgarian | Greek | Polish |
Chinese (Simplified) | Haitian Creole | Portuguese |
Chinese (Traditional) | Hebrew | Romanian |
Czech | Hungarian | Russian |
Danish | Indonesian | Slovak |
Dutch | Italian | Slovenian |
English | Japanese | Spanish |
Estonian | Korean | Swedish |
Finnish | Latvian | Thai |
French | Lithuanian | Turkish |
Note: AEM 6.1 refers to AEM 6.1 Communities FP3 and earlier.
For the SRP collection (either MSRP or DSRP), to support Standard Multilingual Search (MLS) it is necessary to modify two of Solr’s configuration files:
Standard MLS files (schema.xml, solrconfig.xml) for Solr 4.10.
Standard MLS files (schema.xml, solrconfig.xml) for Solr 5.x.
The Standard MLS files are stored in the AEM repository.
Note: While the Solr files are stored in the msrp/ folder, they are also for DSRP (no changes necessary).
Download instructions: Replace solrX
with solr4
or solr5
as appropriate.
Using CRXDE|Lite, locate:
/libs/social/config/datastore/msrp/solrX/schema.xml
/libs/social/config/datastore/msrp/solrX/solrconfig.xml
Download to local server on which Solr is deployed.
jcr:content
node’s jcr:data
property.view
.Follow the installation instructions for either standalone or SolrCloud mode.
Install and configure Solr in SolrCloud mode.
Prepare a new configuration:
Create new-config-dir* such as solr-install-dir*/myconfig/
Copy the contents of the existing Solr configuration directory to new-config-dir
solr-install-dir/example/solr/collection1/conf/
solr-install-dir/server/solr/configsets/data_driven_schema_configs/
Copy the downloaded schema.xml and solrconfig.xml to new-config-dir to overwrite existing files.
Upload the new configuration to ZooKeeper.
Create a collection specifying the necessary parameters, such as number of shards, number of replicas, and configuration name.
If the configuration name was *not *provided during creation of the collection, link this newly created collection with the configuration uploaded to ZooKeeper.
For MSRP, run MSRP Reindex Tool, unless this installation is new.
Install Solr in standalone mode.
If running Solr5, create a collection1 (similar to Solr4):
./bin/solr start
./bin/solr create_core -c collection1 -d sample_techproducts_configs
Backup schema.xml and solrconfig.xml in the Solr config dir, such as:
solr-install-dir/example/solr/collection1/conf/
solr-install-dir/server/solr/collection1/conf/
Copy the downloaded schema.xml and solrconfig.xml to that same directory.
Restart Solr.
For MSRP, run MSRP Reindex Tool, unless this installation is new.
For the SRP collection (MSRP or DSRP) to support advanced MLS, new Solr plug-ins are required in addition to a custom schema and Solr configuration. All required items are packaged into a downloadable zip file. In addition, an install script is included for use when Solr is deployed in standalone mode.
To obtain the Advanced MLS package, see AEM Advanced MLS in the deploy section of the documentation.
To get started with the install for either SolrCloud or standalone mode:
Installation instructions - note the few differences for Solr4 and Solr5:
Install and configure Solr in SolrCloud mode.
Extract the contents of the Advanced MLS package to disk. The contents should include:
Prepare a new configuration:
Create a new-config-dir
solr-install-dir/myconfig/
stopwords/
and lang/
Copy the contents of the existing Solr config dir to new-config-dir
solr-install-dir/example/solr/collection1/conf/
solr-install-dir/server/solr/configsets/data_driven_schema_configs/
Copy the extracted schema.xml and solrconfig.xml to new-config-dir to overwrite existing files.
For Solr5: Copy solr_install_dir/server/solr/configsets/sample_techproducts_configs/conf/lang/*.txt
to new-config-dir/lang/
Copy the extracted stopwords/ folder to new-config-dir resulting in new-config-dir/stopwords/*.txt
Upload the new configuration to ZooKeeper
Copy the new profiles/ folder …
Create a lib/ folder in the solr-home directory (contains solr.xml) of each node in SolrCloud. Copy jars from the following locations to the new lib/ folder on each node:
Create a collection specifying the necessary parameters, such as number of shards, number of replicas, and configuration name.
If the configuration name was not provided during creation of the collection, link this newly created collection with the configuration uploaded to ZooKeeper.
For MSRP, run MSRP Reindex Tool, unless this installation is new.
An install script is included in the Advanced MLS package.
After the contents of the package are extracted to the server hosting the standalone Solr server, run the install script to install the necessary resources and configuration files.
Install Solr in standalone mode.
If running Solr5, create a collection1 (similar to Solr4):
./bin/solr start
./bin/solr create_core -c collection1 -d sample_techproducts_configs
Run the install script: Install [-v 4|5] [-d solrhome] [-c collectionpath]
where:
-d solrhome
Solr installation directory
-c collectionpath
Collection path in solr
–help
Print command line options
-v [4|5]
Set version for solr
Example for Solr 4.10.4:
Example for Solr 5.4.0:
Note:
The solrconfig.xml file controls the auto commit interval and search visibility and requires testing and tuning.
<autoCommit>
: By default, the AutoCommit interval, which is a hard commit to stable storage, is set to 15 seconds. The search visibility defaults to using the pre-commit index.
To change search to use an index updated to reflect changes due to the commit, change the contained openSearcher
to true.
autoSoftCommit
: A ‘soft’ commit ensures that changes are visible (the index is updated), but does not ensure that changes are synced to stable storage (hard commit). The result is an improvement in performance. By default, autoSoftCommit
is disabled with the contained maxTime
set to -1.