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

wip/experimental(elasticsearch): Use secondary index for Item and ImageObject #1569

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

andersju
Copy link
Member

@andersju andersju commented Mar 5, 2025

So as to not burden the main ES index with a massive amount of Item and ImageObject records (that we usually don't care much about when searching) we've talked about using separate indices. Here's a very simple way of doing that. Not saying it's necessarily a good way, but just to open up the discussion and get more ideas. It Seems To Work (tm).

Essentially this just splits ES into a "main" index and a "secondary" index, for lack of a better name, with the latter having only Item and ImageObject records. Both are used by default when searching, so no change from the outside. _searchMainOnly=true can be added to not search the secondary index. Index to use when adding/updating records is determined based on type.

To try it locally see https://github.com/libris/devops/tree/feature/use-secondary-es-index for some quick and dirty devops support.

@andersju andersju requested review from olovy and kwahlin March 5, 2025 13:46
Copy link
Contributor

@kwahlin kwahlin left a comment

Choose a reason for hiding this comment

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

Nice! If it seems to work let's try it out in a test environment.

Copy link
Contributor

@olovy olovy left a comment

Choose a reason for hiding this comment

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

Nice!

Agree that this is a good starting point for measuring potential performance improvements etc.
Also nice to see that splitting the index requires relatively minor changes.
If we are happy with this there is a clear path to generalize it to separate indices per selected base type. And of course select indices to search based on the query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants