You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to request all audience segments which start from "PA - " but the API looks like returns audience segments with the search term not only at the beginning of the name, but also in any part of the name.
This is how my code looks like:
@Override
public List<AudienceSegment> findAllPAs() {
StatementBuilder statementBuilder =
new StatementBuilder()
.where("name LIKE 'PA - %' and type = 'FIRST_PARTY'")
.orderBy("id ASC");
return findAllAudienceSegmentsByStatement(statementBuilder, StatementBuilder.SUGGESTED_PAGE_LIMIT);
}
private List<AudienceSegment> findAllAudienceSegmentsByStatement(StatementBuilder statement, int limit) {
statement.limit(limit);
List<AudienceSegment> segments = new ArrayList<>();
int totalResultSetSize = 0;
do {
AudienceSegmentPage page;
try {
page = audienceSegmentService.getAudienceSegmentsByStatement(statement.toStatement());
} catch (RemoteException re) {
throw new RuntimeException(re);
}
if (page.getResults() != null) {
totalResultSetSize = page.getTotalResultSetSize();
segments.addAll(Arrays.asList(page.getResults()));
}
statement.increaseOffsetBy(limit);
} while (statement.getOffset() < totalResultSetSize);
return segments;
}
Thanks,
Andrei
The text was updated successfully, but these errors were encountered:
Hi All,
I'm trying to request all audience segments which start from "PA - " but the API looks like returns audience segments with the search term not only at the beginning of the name, but also in any part of the name.
This is how my code looks like:
Thanks,
Andrei
The text was updated successfully, but these errors were encountered: