Hi,
The initial problem was that I hit the API limit and received
START_INDEX_IS_TOO_HIGH when retrieving report entries with
AdGroupBidModifierServiceInterface using
Paging.
To overcome the API limits I'm trying to narrow the result set by adding
Predicates, so I can obtain the whole result set by making multiple calls that would each return a smaller chunk, but all put together would be the whole set.
This is how my SelectorBuilder looked like initially when hitting the API limit, this used to return 1148352 entries:
new SelectorBuilder().fields(
AdGroupBidModifierField.CampaignId, AdGroupBidModifierField.AdGroupId, AdGroupBidModifierField.BidModifier, AdGroupBidModifierField.Id)
.greaterThan(AdGroupBidModifierField.BidModifier, 0)
And then I tried splitting the result set in smaller chunks by making 2 separate calls with different SelectorBuilders by adding predicates for the BidModifier field:
new SelectorBuilder().fields(
AdGroupBidModifierField.CampaignId, AdGroupBidModifierField.AdGroupId, AdGroupBidModifierField.BidModifier, AdGroupBidModifierField.Id)
.greaterThan(AdGroupBidModifierField.BidModifier, 0)
.lessThan(AdGroupBidModifierField.
BidModifier, 1)
- this works and returns
765568 entries
So the second one that I tried is:
new SelectorBuilder().fields(
AdGroupBidModifierField.CampaignId, AdGroupBidModifierField.AdGroupId, AdGroupBidModifierField.BidModifier, AdGroupBidModifierField.Id)
.greaterThan(AdGroupBidModifierField.BidModifier, 1)
- but this one returns 0 entries
I've tried with other Predicates for this BidModifier field but cannot seem to figure out which one to use to retrieve the rest of the entries: 382784 (1148352 - 765568)
I think that there should be a way to use different predicates to cover all the possible filters that together would result in the complete number of entries.
I think that the missing entries have BidModifier value = 1, because the predicates used .greaterThan(AdGroupBidModifierField.BidModifier, 0) and .lessThan(AdGroupBidModifierField.BidModifier, 1) for the first selector and .greaterThan(AdGroupBidModifierField.BidModifier, 1) for the second one are not including BidModifier=1.
I've tried using greaterThanEquals and lessThanEquals, or equals predicates to achieve that, but these are returning INVALID_PREDICATE_OPERATOR, seems like these cannot be used as predicates for the BidModifier field.
Could you please tell me a way to do the filtering differently or what am I missing to be able to obtain the entries in batches like I tried?