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

Add Support for autocreate of an Index for Loupe and Memory Adapter #471

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Jan 2, 2025

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 (autocreate support).


TLDR; Only adapters which auto create indexes with correct configuration are with this PR:

  • Loupe
  • Memory

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.

@alexander-schranz alexander-schranz added features New feature or request Adapter: Loupe Loupe Adapter related issue labels Jan 2, 2025
@alexander-schranz alexander-schranz force-pushed the enhancement/loupe-auto-create-index branch from e4d32bd to 9c658f7 Compare January 2, 2025 14:38
@alexander-schranz alexander-schranz changed the title Add Support for autocreate of an Index for Loupe Adapter Add Support for autocreate of an Index for Loupe and Memory Adapter Jan 2, 2025
@alexander-schranz alexander-schranz added the Adapter: Memory Memory Adapter related issue label Jan 2, 2025
@alexander-schranz alexander-schranz marked this pull request as ready for review January 2, 2025 14:56
@alexander-schranz alexander-schranz merged commit 4ea3434 into PHP-CMSIG:0.6 Jan 2, 2025
46 of 47 checks passed
@alexander-schranz alexander-schranz deleted the enhancement/loupe-auto-create-index branch January 2, 2025 15:02
@alexander-schranz
Copy link
Member Author

@Toflar FYI

@Toflar
Copy link
Member

Toflar commented Jan 3, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adapter: Loupe Loupe Adapter related issue Adapter: Memory Memory Adapter related issue features New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants