Multi-Tenant Elasticsearch Index Names

Priority

Components

Affects versions

None

Description

(On Elastic Stack only.)

Liferay Company (Virtual Instance) indexes:

<customer_defined_prefix>-<companyId>

Application contributed indexes:

<customer_defined_prefix>[<companyId>][-<application_defined_index_name>]

Definitions

  • <customer_defined_prefix>- is determined by the "indexNamePrefix" property of the Elasticsearch 6/7 connector configuration. Defaults to "liferay-".

  • <companyId> is the "companyId" of the given Company in the database. It is displayed as "Instance ID" in the UI and represents the Virtual Instance.

  • -<application_defined_index_name> is defined by the application's developer.


Background

What is a multi-tenant Liferay DXP-Elasticsearch stack?

A DXP-Elasticsearch stack is multi-tenant if a single Elasticsearch cluster hosts the indexes of multiple DXP deployments. These deployments can be different production deployments or different environments of the same deployment.

Multi-tenancy in Liferay DXP 7.2 prior to SP3/FP8

Multi-tenant DXP 7.2-Elasticsearch deployments are not supported prior to the DXP 7.2 SP3/FP8 patch level.

Read more about this topic and the related changes in the Help Center.

Multi-tenancy in Liferay DXP 7.3

The necessary changes will be included in DXP 7.3 GA1.


Verification

DXP 7.3 GA1 out-of-the-box index names

Assuming there is only one Virtual Instance (aka. company) and you are using the default "indexNamePrefix" Elasticsearch connector configuration, the index names look like these on a vanilla installation:

DXP 7.2 SP3+/FP8+ out-of-the-box index names

Assuming there is only one Virtual Instance (aka. company) and you are using the default "indexNamePrefix" Elasticsearch connector configuration, the index names look like these on a vanilla installation:

Test Scenarios

1. Moving to DXP 7.2 SP3+/FP8+ patch level from SP1/FP2

Use case: same as below, but instead of doing an upgrade, install DXP 7.2 FP? and no need to reindex.

Expected index names on the new patch level: see the "DXP 7.2 SP?/FP? out-of-the-box index names" section above.

2. Moving to DXP 7.2 SP3+/FP8+ patch level from SP2/FP5

Use case: same as below, but instead of doing an upgrade, install DXP 7.2 FP? and no need to reindex.

Expected index names on the new patch level: see the "DXP 7.2 SP?/FP? out-of-the-box index names" section above.

3. Moving to DXP 7.2 SP3+/FP8+ patch level from SP1/FP2 using custom "indexNamePrefix"

Use case: same as below, but instead of doing an upgrade, install DXP 7.2 FP? and no need to reindex.

Configure "indexNamePrefix" as "dxp" in "com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config".

The new indexes should be prefixed with "dxp".

Expected index names on the new patch level: see the "DXP 7.2 SP3+/FP8+ out-of-the-box index names" section above.

4. Moving to DXP 7.2 SP3+/FP8+ patch level from SP2/FP5 using custom "indexNamePrefix"

Use case: same as below, but instead of doing an upgrade, install DXP 7.2 FP? and no need to reindex.

Configure "indexNamePrefix" as "dxp" in "com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config".

The new indexes should be prefixed with "dxp".

Expected index names on the new patch level: see the "DXP 7.2 SP3+/FP8+ out-of-the-box index names" section above.

5. Same as 1-4, but using Elasticsearch 6.8.x

Expected index names on the new patch level: see the "DXP 7.2 SP3/FP8+ out-of-the-box index names" section above.

6. Upgrading from DXP 7.2 SP2 with Elasticsearch 7

  1. Configure 7.2 SP2 with remote ES7 7.3.x-7.7.x (use v3.0.1 of the connector)

  2. Start Liferay, reindex indexes & spell-check indexes as usual

  3. Enable Single Approval workflow for Web Content Articles

  4. Create a test SLA (Start: Process Begins, Stop: Process Ends: Approved, 1day )

  5. Create 2 articles, submit for publication and then approve and reject 1-1 by the Test Test user

  6. Create a Synonym Set: "liferay", "company"

  7. Create a Result Rankings entry with query "DXP"

  8. Create a new Virtual Instance

  9. Log in to the new instance and repeat the same, but create articles, synonyms and rankings with different keywords

  10. Go to Search admin - Field Mappings and copy the available liferay index names, like

  11. Stop Liferay

  12. Point the your Master/7.3 bundle and the DB Upgrade Client tool to the 7.2 SP2 database & perform an upgrade

  13. Configure 7.3 bundle to connect to the same remote ES7 server

  14. Start Liferay

  15. Perform a reindex

  16. Visit Synonym Sets, Result Rankings and Workflow Metrics at both virtual instances & verify that the data are there

  17. Go to Search admin - Field Mappings and verify that there are the following liferay indexes are available:

Note: if you are testing on 7.2, the name of the workflow metrics indexes will be different, we expect to find indexes with names described in the "DXP 7.2 SP3+/FP8+ out-of-the-box index names" section above.

7. Upgrading from DXP 7.2 SP? with Elasticsearch 7

Same as 6).

Related Resources.

See in a comment below.

Attachments

3
100% Done
Loading...

Activity

Show:

Raven Song September 4, 2020 at 12:40 AM
Edited

Test Scenario 3:
Since not clear which version should I use, so I use Elasticsearch 7.5 for test.
Test Scenario 1:

  1. Setup remote Elasticsearch 7.5

  2. Blacklist embedded Elasticsearch 6.5

  3. Add com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config with indexNamePrefix="dxp"

  4. Start portal

  5. Deploy Liferay Connector to Elasticsearch 7 lpkg(Liferay DXP 7.2 GA1+ Fix Pack 2)

  6. Go to Control Panel > Configuration > System Settings > Search > Elasticsearch 7 > Operation Mode: Remote

  7. Reindex, go to Search admin - Field Mappings

  8. Shutdown

  9. Install FP8

  10. Start ortal

  11. Deploy 5 jars build from 7.2.x head

  12. Connect remote ES 7.5

  13. Since description said no need to reindex, go to Search admin - Field Mappings
    After reindex:

Tibor Lipusz September 4, 2020 at 12:04 AM

They're also create automatically on DXP bundles. See the description of this ticket for the index names.

Raven Song September 3, 2020 at 11:41 PM
Edited

Test Scenario 2:

  1. Setup remote Elasticsearch 7.5

  2. Blacklist embedded Elasticsearch 6

  3. Start portal

  4. Deploy Liferay Connector to Elasticsearch 7 lpkg(Liferay DXP 7.2 GA1+ Fix Pack 5)

  5. Go to Control Panel > Configuration > System Settings > Search > Elasticsearch 7 > Operation Mode: Remote

  6. Reindex, go to Search admin - Field Mappings

  7. Shutdown

  8. Install FP8

  9. Start ortal

  10. Deploy 5 jars build from 7.2.x head

  11. Connect remote ES 7.5

  12. Since description said no need to reindex, go to Search admin - Field Mappings

  13. After reindex:

Raven Song September 3, 2020 at 11:27 PM

What is search tuning indexes and how to do search tuning indexes?

Tibor Lipusz September 3, 2020 at 11:16 PM

You're missing the search tuning indexes.

Regarding the version: 7.5 is fine, however we support up-to 7.9.x. through the Connector to Elasticsearch 7, but it doesn't make any differences in this case, so you don't need to repeat the test.

Completed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Due date

Zendesk Support

Created July 22, 2020 at 9:31 AM
Updated September 22, 2021 at 11:02 AM
Resolved September 17, 2020 at 11:11 PM