wip/experimental(elasticsearch): Use secondary index for Item and ImageObject #1569
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.