Skip to content
Examples for the usage of Solr in AEM
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
application
clientlibs
complete
config-definition
misc
parent
sample-content
.gitattributes
.gitignore
LICENSE
README.md
clean_install_deploy_package.sh
pom.xml

README.md

AEM Solr Sample

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.

Implemented Features

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)

Quickstart

You don't need to configure anything manual using this project, just checkout the Git repository and perform the following steps:

Requirements

If you want to run this project without any required modifications, this should be available on your machine:

Start Solr using Vagrant

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

Provision AEM

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.

Manual Setup

The following steps are not required if you use the Quickstart Guide above.

Requirements

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.

Solr

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.

AEM

System Console

System Console:

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

CRXDE Lite

CRXDE Lite:

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

You can’t perform that action at this time.