Enum RecordCountType
Used by the (optional) Action<RecordCountType, int> recordCountCallback methods available on all IContentResolver.GetContent() and IContentResolver.GetContentByIds() methods. If this Action is supplied to those methods, the ContentResolver will invoke it periodically during its operation to notify the caller of the Archer search API's execution progress. Each time the callback is invoked, it will pass an integer value as well as a value from this enumeration indicating the current meaning of that integer.
Namespace: Estrelica.Archer.Content
Assembly: Estrelica.Interfaces.dll
Syntax
public enum RecordCountType
Current
The integer indicates the total number of records that have been returned so far, as the search is in progress. This invocation will occur on a periodic basis, with the period configured via the IContentResolver.CallbackInterval property. This property defaults to 100, meaning that the "Current" callback will be invoked after each hundredth record is returned from Archer. If ContentResolver.CallbackInterval is set < 1, no "Current" callbacks will occur.
Discrepancy
The integer indicates the difference between the total number of records Expected (as reported by Archer) and the Total number actually returned by the search. This callback will occur only if a difference in the two values was found, with a positive value meaning more Total records were returned than were Expected, and a negative value meaning the opposite. If a Discrepancy callback occurs, it is advisable to take appropriate action to ensure the integrity of the search (i.e. rebuild the search index, or re-execute the search to ensure that no inserts/deletes have impacted the results).
Duplicate
In this case the integer does not refer to a count, but instead refers to a content Id which has already been returned (at least) once during the current search execution. If this event occurs it means that the content has changed in Archer while the search was executing, causing records to shift among the results. E.g. if you had sorted records by "Name", a record having the name "A" might be returned on the first page, and then if a user edits that record's name to "Z" while the search is still in progress, the same record will be returned again on the last page. Consequently, all of the records between "A" and "Z" will shift downward in the results, meaning that another record that should have been returned will be skipped by Archer. Therefore, in the event that this event occurs, the results of the search should not be trusted. Furthermore, this will only occur if you're executing a search that is sorted on a field that is subject to modification (e.g. a user-editable field like "Name" in the example above). A good way to avoid this scenario is to sort "Ascending" on an incremental field that cannot be changed, such as Tracking Id or First Published, or to specify no sort in your search criteria (in which case Estrelica.Core will default to sorting Ascending by Tracking Id).
Expected
The integer indicates the total number of records expected to be returned for the current search. This callback will occur only once, at the outset of the search execution, indicating the expected record count reported by Archer.
Total
The integer indicates the total number of records that were actually returned for the search. This callback will occur only once, after the final page has been returned, and represents the cumulative total of records returned for all pages. While this final count is expected to match the "Expected" value returned at the outset, this expectation may fail if Archer's search index becomes corrupted or if records have been inserted/deleted in the relevant module while the search is underway.