Reindexing lucene indices enables you to use reindexed indices with Elasticsearch.
NOTE: Reindexing can be very time consuming. To avoid unwanted reindexing, see the following examples below for setting time and initiating dry start.
Prerequisite
-
Sessions and audit trails are still available (were not cleaned up).
-
Make sure you have SPS version 6.0 (or later).
To reindex lucene indices
-
Create and run the following Python script from the core shell.
#!/usr/bin/env python
from datetime import datetime
import os.path
content_store_changed_filename="/opt/scb/var/upgrade/content-store-changed-time/content_store_changed_timestamp"
if not os.path.isfile(content_store_changed_filename):
print("The "+content_store_changed_filename+" file does not exist. This file contains the information when lucene storage was updated to elastic search.")
exit()
f=open(content_store_changed_filename)
s=float(f.read())
f.close()
my_date = datetime.fromtimestamp(s)
print("Run this command to reindex everything before lucene->elasticsearch update:")
print("indexerctl reindex query \"*\" --end "+my_date.isoformat())
You will receive a result similar to this:
Example
indexerctl reindex query "*" --end 2021-05-22T20:21:05.604341
The example shows that all items will be reindexed until 2021-05-22 20:21:05.
-
You can set the start time parameter and check the list of items scheduled for reindexing:
Example
indexerctl reindex query "*" --end 2021-05-22T20:21:05.604341 --dry --start 2021-05-22T18:21:05.604341
The example shows that all indices will be reindexed between 2021-05-22 18:21:05 and 2021-05-22 20:21:05.
-
If you are satisfied with the results, start reindexing:
Example
indexerctl reindex query "*" --end 2021-05-22T20:21:05.604341 --start 2021-05-22T18:21:05.604341