Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Is there a way of returning more than 100 results in DSL search API Atlas query?

avatar
Rising Star

I can only return a maximum of 100 results when doing a DSL API search in Atlas. Is this by design or a bug?

Even with a limit of 1000 only 100 items are returned

curl -k -u admin:admin -H "Content-type:application/json" -X GET https://url:port/api/atlas/v2/search/dsl?query=hive_column%20where%20__state%3D%27ACTIVE%27%20and%20... | python -m json.tool > hive_column_prod_data_lake_limit.json

No limit yet still 100 items are returned. There are a lot more than 100 items - when I do the same for hive_tables only 100 items are returned.

curl -k -u admim:admin -H "Content-type:application/json" -X GET https://url:port/api/atlas/v2/earch/dsl?query=hive_column%20where%20__state%3D%27ACTIVE%27%20and%20q... | python -m json.tool > hive_column_prod_data_lake.json

This is on a 2.6.3 HDP install.

1 ACCEPTED SOLUTION

avatar
Rising Star

@Laura Ngo - by default the query returns maximum of 100 results. To retrieve more results, please add query parameter "limit" in the REST call, as shown below (addition of query parameter "limit=1234"):

curl -k -u admim:admin -H "Content-type:application/json"-X GET https://url:port/api/atlas/v2/earch/dsl?limit=1234&query=hive_column%20where%20__state%3D%27ACTIVE%2... | python -m json.tool > hive_column_prod_data_lake.json

Please note that a maximum of 10,000 results will be returned even if limit specified is higher.

Both default and the max limit can be configured with the following properties:

atlas.search.defaultlimit=100
atlas.search.maxlimit=10000

View solution in original post

2 REPLIES 2

avatar
Rising Star

@Laura Ngo - by default the query returns maximum of 100 results. To retrieve more results, please add query parameter "limit" in the REST call, as shown below (addition of query parameter "limit=1234"):

curl -k -u admim:admin -H "Content-type:application/json"-X GET https://url:port/api/atlas/v2/earch/dsl?limit=1234&query=hive_column%20where%20__state%3D%27ACTIVE%2... | python -m json.tool > hive_column_prod_data_lake.json

Please note that a maximum of 10,000 results will be returned even if limit specified is higher.

Both default and the max limit can be configured with the following properties:

atlas.search.defaultlimit=100
atlas.search.maxlimit=10000

avatar
Rising Star

@Laura Ngo - the API shared by @Madhan Neethiraj is the correct one which you can use. However, in addition to it, I would like to inform you that if you have more than 10000 results and want to scroll between them you can use offset option like below query.

curl -k -u admim:admin -H "Content-type:application/json"-X GET https://url:port/api/atlas/v2/earch/dsl?limit=10000&offset=20000&query=hive_column%20where%20__state... | python -m json.tool > hive_column_prod_data_lake.json