This bundle uses a set of events to allow developers to listen and interact during the whole process.
Three events are dispatched during the document lifecycle:
- PreDocumentCreationEvent: Allow to retrieve the index and the document before the creation.
- PreDocumentDeletionEvent: Allow to retrieve the document and the index before removing the document, by default, the document is fetched before being deleted. This event is not triggered when a set of documents is deleted.
- PreDocumentRetrievedEvent: Allow to retrieve the document identifier and the index before fetching it.
- PreDocumentUpdateEvent: Allow to retrieve the document before the update.
- PostDocumentCreationEvent: Allow to retrieve the update identifier when a document has been created.
- PostDocumentDeletionEvent: Allow to retrieve the document deletion identifier.
- PostDocumentRetrievedEvent: Allow to retrieve the document and the index before returning the document, by default, the document is returned as stored in MeiliSearch.
- PostDocumentUpdateEvent: Allow to retrieve the document update identifier.
Three events are dispatched during the index lifecycle:
- IndexCreatedEvent: Allow to retrieve the
Index
and the related configuration after creating it - IndexRemovedEvent: Allow to retrieve the uid of the deleted index after the deletion
- IndexRetrievedEvent: Allow to retrieve the
Index
after retrieving it
Two events are dispatched during the search lifecycle:
- PreSearchEvent: Allow to retrieve the configuration used to trigger a search.
- PostSearchEvent: Allow to retrieve the
Search
instance which contain the result of the search.
Four events are dispatched during synonyms lifecyle:
- PreUpdateSynonymsEvent: Allow to retrieve the index and the new synonyms before updating the synonyms.
- PostUpdateSynonymsEvent: Allow to retrieve the index and the update identifier after updating the synonyms.
- PreResetSynonymsEvent: Allow to retrieve the index before resetting the synonyms.
- PostResetSynonymsEvent: Allow to retrieve the index and the update identifier after resetting the synonyms.
Each event is listened and trigger an info()
log when dispatched.