Updating to 4.3 Errors

Created on 14 November 2023, about 1 year ago
Updated 11 April 2024, 7 months ago

Respect the submission guidelines above! Drupal.org issue forks cause additional work for the project maintainer!

Setup

  • Solr version: 8.8.2
  • Drupal Core version: 9.5.11
  • Search API version: 8x - 1.30
  • Search API Solr version: 4.3.1
  • Configured Solr Connector: Pantheon Search Connector

Issue

I'm trying to update from 4.2.10 to 4.3.1 and have followed the instructions in the release notes but I'm still getting cannot change field "xyz" from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS. errors.

  1. I created a new solr server and updated the config-set using search_api_solr/jump-start/solr8/config-set/ via drush drush sapps pantheon_solr /code/web/modules/contrib/search_api_solr/jump-start/solr8/config-set/ -vvv
  2. Disabled and re-enabled the server e.g. drush sapi-sd pantheon_solr | drush sapi-se pantheon_solr
  3. Reloading the solr core e.g. drush solr-reload pantheon_solr
  4. Switch an existing index to use the new server and re-index - get errors
  5. Create a new index on the new server - get errors

All the errors seem to come from fulltext fields.

Also this all works locally using lando but not on any Pantheon environment - using the Pantheon recipe for Lando. I've been working with Pantheon on this - but no luck so far.

πŸ’¬ Support request
Status

Fixed

Version

4.3

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States jseltzer

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jseltzer
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    Everything you describe in steps 1-4 are updates with existing data. That doesn't work. If you mean a Search API "server" in 6, that doesn't work.

    You need to delete and re-create the Solr core! (Or the collection in case of Solr Cloud)

  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    Did you read the release notes?

    How to upgrade from 4.2.x or earlier

    In order to support advanced highlighting and other features, the Solr schema provided by Search API Solr 4.3 got some fundamental changes, for example the usage of StandardTokenizer and storeOffsetsWithPositions.
    When upgrading the module to 4.3.x from 4.2.x and earlier you still can read an existing Solr index and perform searches.
    But if you write (index) data you'll run into errors like cannot change field "xyz" from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS.
    There're different ways to deal with the required update. But all require Solr knowledge.
    But the safest way is to delete the existing core (or collection in case of Solr Cloud) and to create a new core (or collection) using a new Solr config-set generated by Search API Solr 4.3.x and to re-index your data afterwards.
    If you want to avoid downtime of your service, you can also create a new core (or collection), clone and adjust the Search API server and index configs and index all your data twice, while users can still search via the old core (or collection). Afterwards you can use Solr's rename or alias capabilities to switch both cores (or collections) and delete the cloned Search API server and index configs.

  • πŸ‡ΊπŸ‡ΈUnited States jseltzer

    I did read the release notes. With Pantheon we have no option to delete and recreate the core. Those were the steps they gave me as their version of the instructions in the readme - which sounds like it's not going to work. Can close as this appears to be entirely a platform issue.

  • πŸ‡΅πŸ‡­Philippines danreb

    The steps given above actually work in Pantheon because the disabling and enabling of the search API Solr server removes all the data in the disk or in Pantheon Solr backend, this is true with the Drupal CMS setup with a Single search API Solr server and a Single index ID.

    In the case of a complex setup where the site is using multiple Search API Solr servers (Multiple Solr Server IDs) with multiple Index items assigned for each Search API Solr server, there is a need to use the module search_api_solr_devel and then use the Drush command that comes with it just like this in case the Server ID is named pantheon_solr

    drush search-api-solr:devel-delete-all pantheon_solr

    This needs to be executed before step number 3 or reloading of the Solr core.

  • Status changed to Fixed 12 months ago
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States sjhuskey

    I'm sorry for reopening this, but I could use some clarification before I create a bunch of work for myself. I have a collection with four indexes, each customized in its own way. If I delete the collection as recommended, do I need to redo all of those customizations? I just want to be sure to budget my time appropriately before I start breaking things.

    I did a test without deleting the collection. I created some new content and queued everything for reindexing. The reindexing was successful without the error mentioned here.

Production build 0.71.5 2024