Skip to content

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 kwahlin and olovy 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.

4 participants