This step implements the different moving parts of updating Collections data to Library Component documents in Meilisearch. To do that we need to:
Extend the search Fields class to include collections
Since there can be multiple collections, that field would be an array
Add an upsert_block_collections_index_docs function updates the collections data in documents for the given library block (similar to upsert_block_tags_index_docs)
Rename existing event CONTENT_OBJECT_TAGS_CHANGED to CONTENT_OBJECT_ASSOCIATIONS_CHANGED and add a data field to indicate which associations have changed (tags or collections).
This event fires when the library component/object’s tags or collections change, and hence would call the new upsert function to update the tags and/or collections in the documents in meilisearch
This step implements the different moving parts of updating Collections data to Library Component documents in Meilisearch. To do that we need to:
Fields
class to includecollections
upsert_block_collections_index_docs
function updates the collections data in documents for the given library block (similar to upsert_block_tags_index_docs)CONTENT_OBJECT_TAGS_CHANGED
toCONTENT_OBJECT_ASSOCIATIONS_CHANGED
and add a data field to indicate which associations have changed (tags
orcollections
). This event fires when the library component/object’s tags or collections change, and hence would call the new upsert function to update the tags and/or collections in the documents in meilisearchAdded to this issue: