SaidbakR
SaidbakR

Reputation: 13554

Solr luceneMatchVersion syntax

I have Solr 4.10 and I have collection on it with solorconfig.xml has the value for <luceneMatchVersion> as follows:

<luceneMatchVersion>4.7</luceneMatchVersion>

Is this correct? I saw other examples that has values such as LUCENE_35 What I need to know also, how could I express LUCENE_xx from my current Solr version?

Upvotes: 4

Views: 4739

Answers (3)

mbomb007
mbomb007

Reputation: 4271

If anyone is using Drupal, the Search API Solr (search_api_solr) module has config templates by version in /sites/all/modules/search_api_solr/solr-conf/.

The template README.md states the following:

The solr-conf-templates directory contains config-set templates for different Solr versions.

These are templates and are not to be used as config-sets!

To get a functional config-set you need to generate it via the Drupal admin UI or with drush solr-gsc. See README.md in the module directory for details.

The module's README.md lists these instructions:

  1. Make sure you have Apache Solr started and accessible (i.e. via port 8983). You can start it without having a core configured at this stage.
  2. Visit Drupal configuration (/admin/config/search/search-api) and create a new Search API Server according to the search_api documentation using "Solr" as Backend and the connector that matches your setup. Input the correct core name (which you will create at step 4, below).
  3. Download the config.zip from the server's details page or by using drush solr-gsc with proper options, for example for a server named
    "my_solr_server": drush solr-gsc my_solr_server config.zip 8.4.
  4. Copy the config.zip to the Solr server and extract.

I generated a config file for 8.x, and it uses this:

<luceneMatchVersion>${solr.luceneMatchVersion:LUCENE_80}</luceneMatchVersion>

Upvotes: 0

Markomafs
Markomafs

Reputation: 546

You should use:

<luceneMatchVersion>4.10.4</luceneMatchVersion>

I recommend you to check your current solr version, in my case was 4.10.4.

Upvotes: 5

Persimmonium
Persimmonium

Reputation: 15789

if you are going to reindex, then both numbers should match. The only reason you might want to have them different, is if you had and index created with say Lucene 4.7, then you would have

<luceneMatchVersion>4.7</luceneMatchVersion>

Then, you upgrade lucene to 4.10.

Now, if among the changes in between 4.7 and 4.10 there are things that work differently regarding analysis (you get the same sentence analysed in both versions and get different output as a result), then, you might want to keep the version number at 4.7, otherwise some queries that contain affected terms might not work (as they were analysed at index time in a different way than at query time). You have to asses how critical that issue might be.

That is why the recommendation is to upgrade, change the setting to the current number, and reindex. This way you are sure to avoid any issue.

Upvotes: 0

Related Questions