About the orderingId Parameter
About the orderingId Parameter
All Push API requests, except for the Create a file container and Set the status of a Push source requests, have an orderingId parameter.
When this parameter is optional, its value indicates the age of the request: a lower orderingId value corresponds to an older request.
By default, the Push API automatically sets this parameter to the current number of milliseconds since the Unix epoch (for example, 1506700606240).
You can also provide your own optional orderingId parameter values when making Push API requests.
When doing so, make sure to increment the orderingId value with each new Push API request.
In essence, each Push API request must have an optional orderingId parameter value higher than the previous request, or consistency issues will occur.
When the orderingId is required, as in the Delete old items and Delete old security identities requests, it has a different meaning.
In these two cases, the orderingId value indicates that the service should try to delete or disable any previously pushed item or security identity whose orderingId value is strictly lower than the one specified in the request.
|
|
Unless you’re setting your own For example, if you use an |
A Push API request whose optional orderingId value is 1506700606240 is older than a request whose optional orderingId value is 1506700606241.
When performing a delete-items-older-than request, specifying 1506700606241 as the value for the required orderingId indicates that the service should try to delete all previously pushed items with optional orderingId values that are lower (that is, older) than 1506700606241.
Potential issues
Critical consistency issues may arise if you carelessly assign custom optional orderingId values in your Push API requests.
Therefore, you should make sure you know exactly what you’re doing if you choose not to let the Push API automatically set the value of the optional orderingId.
You perform a Push API request to add a new item in a Push source.
You decide to use 42 as the custom optional orderingId value for this request.
Later, you decide to perform a delete Push API request to remove that same item from the source.
This time, you decide to use 40 as the optional orderingId value.
Since 40 is lower (that is, older) than 42, the Push API considers the delete request to predate the add request, which makes no sense.
Consequently, the delete operation fails at the indexing stage (with the OUT_OF_SEQUENCE_OPERATION error code in the source logs).
|
|
The Crawling Module and the Coveo for Sitecore integration both use the Push API, and they both set their own opaque optional |