Using SOLR 6 in Alfresco Community Edition 5.2 (201612 GA)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using SOLR 6 in Alfresco Community Edition 5.2 (201612 GA)

afaust
Master
10 4 4,178

Unfortunately SOLR 6 / Alfresco Search Services was released as an Early Access (EA) module without any documentation, either part of docs.alfresco.com, in this platform or at least bundled with the download. Documentation is not due to arrive until the Alfresco One 5.2 release in Februrary 2017 (as per reply to5.2 documentation does not contain SOLR 6 information ).

This page is a community attempt to collect basic information to allow members to setup SOLR 6.

Installation

Alfresco Search Services (SOLR 6) is available as a ZIP download viaAlfresco Community Edition file list 201612. Simply unzip the file to a location of your choice.

SOLR 6 comes with a Jetty container and no longer needs a Tomcat to run. The expanded bundle can be used immediately to startup SOLR. If you want to parameterize SOLR you can either pass command line arguments, or edit the solr.in.cmd / solr.in.sh files and set parameters there.

Common parameters are:

  • SOLR_HOME - the path to the solrHome folder extracted from the bundle (default: ../solrHome relative to the solr folder)
  • SOLR_PORT - the port SOLR will listen to (default 8983)
  • SOLR_SOLR_CONTENT_DIR - the path to the folder where SOLR should cache compressed JSON files with node metadata (default: ContentData inside of solrHome)
  • SOLR_JAVA_MEM - JVM memory parameters
  • SOLR_LOGS_DIR - path to the directory for log output (defaults: ../../logs relative to the solr executable)

TODO: SSL parameters / setup

All SOLR command line interaction will be via the "./solr/bin/solr" executable (actually a .cmd in Windows). Use "./solr/bin/solr start" to start it and "./solr/bin/solr stop" to stop it. The solr.in.cmd / solr.in.sh will be included for default configuration, but you can also pass settings to the executable. Use "./solr/bin/solr usage" for general usage guides and "./solr/bin/solr start -help" for specific start parameters.

Common command line parameters (for start AND stop) are:

  • -p 8983 - the port to bind to
  • -s path - the path to solrHome (long form: -solr.home path)
  • -m 2G - the amount of memory to allocate (will be used as -Xmx and -Xms)
  • -a "..." - to pass additional JVM parameters, e.g. system properties via -D

The Windows command file has various issues in handling parameters. (It has not been verified if .sh scripts suffer as well)

  • do not use quotes around the paths for either SOLR_HOME or SOLR_SOLR_CONTENT_DIR in solr.in.cmd if it contains a whitespace
  • if your intended path for the SOLR cache directory contains a whitespace you cannot use the -a parameter to pass it via the command line (e.g. -a "-Dsolr.content.dir=e:/Alfresco 52") and MUST use solr.in.cmd (using escaped quotes in the command line parameter to surround the path will cause other failures)

Configuring the Repository

Activation and configuration of the SOLR 6 subsystem is done via the alfresco-global.properites as with all previous SOLR versions.

The following properties should be set:

  • index.subsystem.name=solr6
  • solr.secureComms=none
  • solr.port=8983

For some reason the port 8083 is set as the default on the Repository-tier which does not match the SOLR 6 default.

TODO: SSL setup

Creating SOLR cores

Different to SOLR 4, the SOLR 6 solrHome directory comes without any prepared cores and as such does not create any index for Alfresco at all. You must create new cores to begin tracking Alfresco and provide an index for searches. Cores are created similarily to how you would create cores for sharding, documented here (5.1 - creating shards manually).

Example URLs to create single cores for workspace://SpacesStore and archive://SpacesStore:

If your Alfresco Repository runs on a different port than 8080 you need to add the parameter "property.alfresco.port=port" to the URL.

These URLs will create the core configuration folders inside of the SOLR home folder where you can also modify their configuration afterwards (restart required).

SOLR 6 provides only two core templates:

  • rerank
  • rerankWithQueryLog
4 Comments
gethin
Active Member

Hi, I agree its disappointing not to have documentation yet, that's the power of open source development - the code is available before docs have a chance to catch up.

The solr.in.cmd / solr.in.sh were put at the root of the installation zip to make it easier for custom configuration, however its also possible to use environment variables if that's preferred.

To help you create the default cores there's a special command line argument you can pass to Solr that basically just makes the api calls you mention above. 

-Dcreate.alfresco.defaults=alfresco,archive

afaust
Master

You mean "the code will be available before docs" - because I have not seen it yet and am frequently bugging . So far I had to use a decompiler to figure something out when I could not find it in the prepared scripts (e.g. the SOLR_SOLR_CONTENT_MODEL environment variable). Good to know about the "create.alfresco.defaults" parameter - that I have not found yet by browsing decompiled code...

I haven't actually seen the Search Services Quest pages in the private EAP space because it is not regularly linked anywhere from the public areas. It is only via a of this document and my name in one of the pages that I became aware of it, and I can only access it due to my Moderator status as I no longer am a partner employee since September.

gethin
Active Member

The source code is always published with the release to the public maven repo, e.g. Index of /repositories/public/org/alfresco/alfresco-search  . You are probably interested in alfresco-search-1.0.a-sources.jar .  A more user friendly github mirror is planned in the future.

afaust
Master

You are right about the sources JAR - I rarely check them anymore because I have been burned by inconsistent sources in the past (e.g. Index of /groups/public/org/acegisecurity/acegi-security/0.8.2_patched never matched). I really am looking forward to that GitHub repository. Are you planning to be as open about PRs / issues as the Aikau one? Because there have been a lot of needless extensibility limitations that have bugged me a lot in all SOLR versions so far that have been effectively impossible (or let's say futile) to file via JIRA...