Add Support for autocreate of an Index for Loupe and Memory Adapter #471
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.
Sadly it seems like we are not able to standardize IndexNotFoundException (#470) for save, delete, bulk or search actions.
We will still support in Loupe Autocreate of the Index if it does not yet exists.
While Indexes are in some cases autocreated we recommend to create Indexes via the frameworks CLI commands / scripts. Else Search Engine will create there own setting for the indexes and things like searchable, filterable, sortable, does may not work like expected. Why this is not the case for Loupe it is case for other Engine which also support auto create:
They all create indexes with some kind of default settings not the defined mapping of yours.
The following search engines will just fail if you try to save, delete, ... a document from it:
The following search engines will not fail when adding, deleting a document but still no Index exist so nothing is searchable.
So fixes only parts of #463 (autocreate support).
TLDR; Only adapters which auto create indexes with correct configuration are with this PR:
All others are created with the non correct default settings or will fail and createIndex should definitely still be called for them to update the settings of the specific engines correctly.