I’m looking for the total number of elements in the entry array.
I think 15075 is the more accurate figure?
If so is it possible to obtain the 15075 value without paging through all the ‘next’ links until we get to the last page? As an example if I use the following there is no total field:
The reason why a searchset total of 15075 appears in the response is because 35 OrganizationAffiliation records have come back in the response too (because of the _revinclude).
This 15075 total is the 15040 count of Organization records with RO177 plus 35 OrganizationAffiliation records that are associated with the final 40 Organization records.
I am liaising further with our technical team to investigate why the searchset total is not present within all of the queries (i.e. when you change the offset). I will update you asap.
I’ve been provided with some further information re searchset totals and counts:
Why the searchset total does not always appear
There is always a trade off for APIs in terms of speed vs. scope … there is cost to calculating the total number of possible results and the default behaviour is not to provide a total.
This is a characteristic of the _revinclude … e.g. the total reported is the total of all the Organizations that match the search criteria + the OrganizationAffiliations included for the Organizations returned in the specific offset.
The total number of Organizations that match the search criteria is the same regardless of the offset (15040) … but the OrganizationAffiliations will vary depending on the Organizations in the current search offset window e.g. for the offset of 14989 it is 48 giving a total of 15088 (15040 + 48) … but for an offset of 15000 it is 35 giving a total of 15075 (15040 + 35).
The entries array is a searchset Bundle and the entries array size will vary by offset
A quick way of finding the total count from a search is to specify _count=0