Hi team, i'm using GraphQL (getSearchResultsForMul...
# getting-started
f
Hi team, i'm using GraphQL (getSearchResultsForMultiple) with keyword "*" to retrieve aggregated tags of dataset in the facet field. However, it only returns 20 tags. How can I return all of them? Update: I discovered that using the GQL variable 'searchFlags.maxAggValues' should change the bucket count limit according to the documentation: [https://datahubproject.io/docs/0.10.5/graphql/inputObjects#searchflags]. However, it's not working as expected. cc: @big-carpet-38439, @victorious-lawyer-73072
r
Hey Alex, you can use below graphql query to list all data assets in container by urn.
Copy code
query getSearchResultsForMultiple {
  searchAcrossEntities(
    input: {types: [], query: "*", start: 0, count: 100, orFilters: [{and: [{field: "container", values: ["urn:li:container:1a401b085c72131bee205712654a890f"]}]}]}
  ) {
    start
    count
    total
    searchResults {
      entity {
        urn
        __typename
      }
    }
  }
}

Or you can bypass the pagination
const pageSize = 20;
let allTags = [];
let hasNextPage = true;
let page = 1;

while (hasNextPage) {
  const result = makeGraphQLRequest(page);
  const tags = result.getSearchResultsForMultiple.tags;
  allTags = allTags.concat(tags);
  hasNextPage = result.getSearchResultsForMultiple.pageInfo.hasNextPage;
  page++;
}

// Now 'allTags' contains all the tags.
Thanks, Avani.
f
Hi @lemon-application-45367 In my use case, I need to filter for specific datasets and then aggregate their tags. I'm using 'getSearchResultsForMultiple', but the response in the 'facets' field for 'tags' does not return the aggregation of all tags from the filtered datasets. The count of facets (buckets) is limited to 20. I discovered that using the GQL variable 'searchFlags.maxAggValues' should change the bucket count limit according to the documentation: [https://datahubproject.io/docs/0.10.5/graphql/inputObjects#searchflags]. However, it's not working as expected; I still only get 20 tag aggregations.
Always getting 20 tag aggregations, similar to what's shown in the UI, but there should be more.
r
Hey @dazzling-judge-80093 @famous-waitress-64616 , Do you guys have any suggestions here.