Algolia limits individual record size for performance reasons. The limits depend on your plan. If a record is larger than the threshold, Algolia returns the error message
Record is too big.
To reduce the amount of errors thrown, the extension truncates or skips attributes with values that are larger than a certain size.
The function below throws the warning error:
The private method
handleTooBigRecord() evaluates attributes and flags large ones.
This preventive strategy isn’t always perfect as some attributes are important for search.
There are two options that can resolve this error: upgrading your plan or reducing attribute size.
As mentioned before, record size limits depend on your plan. Upon installation, the extension fetches your plan’s record size limit and saves it to Magento’s configuration data under this path:
If you upgraded your limit, unset this value in the
core_config_data table. This forces the extension to fetch the plan value again and store it. The default value is 10 KB.
description, have a lot of content or hidden script tags that aren’t necessary for search. To reduce the size of this attribute, strip the HTML tags before indexing.
To change attributes before indexing, create an observer on the dispatched event for the entity you need.
For products, this event is:
Refer to the customization guide for more details on updating attribute data. For this example, you can leverage the native PHP function
strip_tags() to strip the HTML tags out.
Below is an example of the product observer to update the description attribute: