Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spellchecker : Fix multi index by alias error #3199

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

PierreGauthier
Copy link
Contributor

No description provided.

// Compute the mtermvector query on all indices.
foreach (array_keys($stats['indices']) as $indexName) {
// Compute the mtermvector query on all shards to ensure exhaustive results.
foreach (range(0, $shards - 1) as $shard) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have 2 indices having the same alias, and each of these indices having 3 shards.

What do you have in $shards at this step ? 6 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but you don't have the information of which shard is assigned to which index

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm so if I understand properly, if we have :

  • index "aaaa" with 3 shards
  • index "bbbb" with 3 shards
  • they both share the "product" alias

In the end, in routing, we'll have :

  • [aaaa][0], [aaaa][1], [aaaa][2], [aaaa][3], [aaaa][4], [aaaa][5]
  • [bbbb][0], [bbbb][1], [bbbb][2], [bbbb][3], [bbbb][4], [bbbb][5]

And it will work even if shards 3 4 and 5 does not exist for these index ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes your example is correct and it seems to work properly even if the shard doesn't exist

@romainruaud romainruaud added the safe to test PR can be tested label Mar 7, 2024
@romainruaud
Copy link
Collaborator

OK for me

@romainruaud romainruaud merged commit 2abeeda into 2.10.x Mar 7, 2024
7 checks passed
@rbayet rbayet deleted the fix-spellchecker-multi-alias branch March 7, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test PR can be tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants