-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Introduce IndexNotFoundException (BC Break) #470
Introduce IndexNotFoundException (BC Break) #470
Conversation
It seems like we are not possbile to standardize this as a lot of Search Engines do not fail when try to add documents to a none existing Index. While for example Elasticsearch and Opensearch have some settings to force error on none created Indexes. Search engines like Algolia and Meilisearch do not have this options. Same for Redisearch which even allow to add Documents but as no Index is created search will still fail. Sadly this also means we can not force that a Index is created with the correct settings and so can fail if something isn't correct. As we are not able to standardize a index not found exception we are also not able to implement auto create for all engines correctly. So the search engines will behave differently if you try to add a document to none existing Engine. As request by @Toflar we will support Autocreate for Indexes of Loupe in #471. |
…471) 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: - Elasticsearch - Opensearch - Algolia - Meilisearch 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: - Solr - Typesense The following search engines will not fail when adding, deleting a document but still no Index exist so nothing is searchable. - Redisearch So fixes only parts of #463. --- TLDR; Only adapters which auto create indexes with correct configuration are with this PR: - Loupe - Memory All others are not created with the correct settings and createIndex should definitely still be called for them to update the settings of the specific engines correctly.
…#471) Sadly it seems like we are not able to standardize IndexNotFoundException (PHP-CMSIG/search#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: - Elasticsearch - Opensearch - Algolia - Meilisearch 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: - Solr - Typesense The following search engines will not fail when adding, deleting a document but still no Index exist so nothing is searchable. - Redisearch So fixes only parts of PHP-CMSIG/search#463. --- TLDR; Only adapters which auto create indexes with correct configuration are with this PR: - Loupe - Memory All others are not created with the correct settings and createIndex should definitely still be called for them to update the settings of the specific engines correctly.
…#471) Sadly it seems like we are not able to standardize IndexNotFoundException (PHP-CMSIG/search#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: - Elasticsearch - Opensearch - Algolia - Meilisearch 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: - Solr - Typesense The following search engines will not fail when adding, deleting a document but still no Index exist so nothing is searchable. - Redisearch So fixes only parts of PHP-CMSIG/search#463. --- TLDR; Only adapters which auto create indexes with correct configuration are with this PR: - Loupe - Memory All others are not created with the correct settings and createIndex should definitely still be called for them to update the settings of the specific engines correctly.
This PR should let us check if all search engines throw a not found exception which we may can catch and rethrow our own exception to maybe build up a auto setup in future (see #463).
BC Breaks
New recommended way to setup
Elasticsearch
andOpensearch
is to disable auto create of indexes, this avoids that a false Schema of your index is created in any case:services: elasticsearch: image: # ... environment: # ... + action.auto_create_index: 'false' # ...
Existing clusters can be updated with:
Todo