This project provides an out of the box example how to use an external Solr instance in AEM. For a detailed introduction, have a look at my blog where I show the required steps to adapt this application to your needs.
The following search features can be tested with this project:
Missing features (planned):
- MoreLikeThis: already available through the query-parameters
mlt=on&mlt.fl=text - Suggester
- Faceting: already available through the query-parameters
facet.field=jcr_mimeType&facet=on&indent=on&q=path_collapsed:*/content/dam/*(requires geometrixx sample content)
You don't need to configure anything manual using this project, just checkout the Git repository and perform the following steps:
If you want to run this project without any required modifications, this should be available on your machine:
- AEM 6.2 running on http://localhost:4502
- Vagrant
- Vagrant Plugin vbguest
You can use the VagrantFile provided in /misc/vagrant to setup a local Solr instance. It assumes that you are using VirtualBox as provider.
vagrant up
This will create a local box running Debian and Solr 6.4. The vm listens on the private only IP 192.168.50.10, so Solr Admin can be reached on 192.168.50.10:8983
As soon as Solr is running, you can start the clean_install_deploy_package.sh which will install a sample-application in AEM and configure AEM to use Solr as Indexer.
The examples use the wcm.io Sample Application enriched with Wikipedia Content created using wiki2aem.
To install the application, basic configuration and sample-content execute the deploy script clean_install_deploy_package.sh.
Afterwards you can find a Search Page on http://localhost:4502/content/wcm-io-samples/en/search.html.
The following steps are not required if you use the Quickstart Guide above.
This readme assumes, that you have a Solr 6.x instance and AEM6.2 running. Depending on your configuration, you need to change the given urls/ports.
- AEM: http://localhost:4502
- Solr: http://192.168.50.10:8983 (see start solr using vagrant)
As soon as Solr is running, you need to create a new core names "oak" and deploy a basic schema.
su - solr
/opt/solr/bin/solr create -c oak
You can find the schema definitions in \misc\schema and should copy them into your core's conf folder and reload the core.
Apache Jackrabbit Oak Solr remote server configuration
Solr HTTP Url: http://192.168.50.10:8983/solr/oak Zookeeper Host: empty
Apacke Jackrabbit Oak Solr server provider
ServerType: Remote Solr
Apache Jackrabbit Oak Solr indexing / search configuration
collapse jcr:content nodes: Enabled
Solr Search Server Configuration
Solr HTTP Url: http://192.168.50.10:8983/solr/oak
Create a new node solrIndex in oak:index with the following properties:
| Property | Type | Value |
|---|---|---|
| jcr:primaryType | Name | oak:QueryIndexDefinition |
| type | String | solr |
| async | String | async |
| reindex | Boolean | true |
As soon as you hit save, AEM will start to index the existing content in Solr. This might take some time, you can see the current amount of documents in the Solr Admin UI