If you've attempted to send more than 20 objectId's in a single view event via the viewedObjectIDs you probably received the 422 Error: "Cannot process more than 20 objects in an event".
This error is warning you of the limitations of the viewedObjectID's parameter which can only take 20 objectID's in a single event. This can happen when you have more than 20 hitsPerPage.
The solution is to send these objectID's in multiple batches, i.e. more than one event. For example, if you have 40 hitsPerPage send two events with 20 objectID's each. Please reference the Send Events documentation when doing so.
InstantSearch's Insight's middleware and AutoComplete's Insights Plugin automatically send more than 20 objectID's viewed in batches so no further work is needed if you use either of these libraries.
Please note that these features are available on the latest versions of InstantSearch and AutoComplete so if you encounter this error with either library, update to the latest version.