Limiting search result details
By default, each search result will contain very limited details—typically only the unique identities (GUID and qualifiedName) and name of each asset. This is intentional, to prevent retrieving more information than you need, as every piece of information you retrieve will add a little bit of time to the overall runtime of your request.
You can request additional details on each search result, though, to make sure the search gives you back exactly the information you require:
Including asset properties
You can specify any properties of an asset you want to include in each search result, including relationships:
- Java
- Python
- Kotlin
- Raw REST API
client.assets.select() // (1)
.includeOnResults(Table.CREATE_TIME) // (2)
.includeOnResults(Table.UPDATE_TIME)
.includeOnResults(Table.COLUMNS)
.stream() // (3)
...
- Start building a FluentSearch query (in this example from a client, using its 'assets' member's
select()method). - Chain as many
includeOnResultscalls as you like. Each method call should include a searchable Atlan field you want to include on each search result. (And this can include relationship attributes as well, such as the columns in a table in this example.) - You can then run the search as you like (in this example, streaming the results directly).
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Table
from pyatlan.model.fluent_search import FluentSearch
client = AtlanClient()
request = (
FluentSearch.select() # (1)
.include_on_results(Table.CREATE_TIME) # (2)
.include_on_results(Table.UPDATE_TIME)
.include_on_results(Table.COLUMNS)
).to_request() # (3)
results = client.asset.search(criteria=request)
- Start building a FluentSearch query (in this example using its
select()method directly). - Chain as many
include_on_resultscalls as you like. Each method call should include a searchable Atlan field you want to include on each search result. (And this can include relationship attributes as well, such as the columns in a table in this example.) - You can then run the search as you like (in this example, converting to a request and running the search using the request).
client.assets.select() // (1)
.includeOnResults(Table.CREATE_TIME) // (2)
.includeOnResults(Table.UPDATE_TIME)
.includeOnResults(Table.COLUMNS)
.stream() // (3)
...
- Start building a FluentSearch query (in this example from a client, using its 'assets' member's
select()method). - Chain as many
includeOnResultscalls as you like. Each method call should include a searchable Atlan field you want to include on each search result. (And this can include relationship attributes as well, such as the columns in a table in this example.) - You can then run the search as you like (in this example, streaming the results directly).
{
"dsl": { // (1)
"query": {
...
},
"from": 0,
"size": 100,
"track_total_hits": true
},
"attributes": [ // (2)
"createTime",
"updateTime",
"columns"
],
"suppressLogs": true,
"showSearchScore": false,
"excludeMeanings": false,
"excludeClassifications": false
}
- Define the search query as you normally would.
- Specify the list of attributes you want to include on each result in the
attributeslist of the request.
Including relationship properties
You can also specify which attributes you want to include on each relationship in each search result:
- Java
- Python
- Kotlin
- Raw REST API
client.assets.select() // (1)
.includeOnResults(Table.COLUMNS) // (2)
.includeOnRelations(Column.NAME) // (3)
.stream() // (4)
...
- Start building a FluentSearch query (in this example from a client, using its 'assets' member's
select()method). - Chain as many
includeOnResultscalls as you like, to include one or more relationships on each search result. - Then chain as many
includeOnRelationscalls as you like. Each method call should include a searchable Atlan field you want to include on each relationship included in each search result. (In this example, every related column that comes back for each search result will include the column's name.) - You can then run the search as you like (in this example, streaming the results directly).
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Table, Column
from pyatlan.model.fluent_search import FluentSearch
client = AtlanClient()
request = (
FluentSearch.select() # (1)
.include_on_results(Table.COLUMNS) # (2)
.include_on_relations(Column.NAME) # (3)
).to_request() # (4)
results = client.asset.search(criteria=request)
- Start building a FluentSearch query (in this example using its
select()method directly). - Chain as many
include_on_resultscalls as you like, to include one or more relationships on each search result. - Then chain as many
include_on_relationscalls as you like. Each method call should include a searchable Atlan field you want to include on each relationship included in each search result. (In this example, every related column that comes back for each search result will include the column's name.) - You can then run the search as you like (in this example, converting to a request and running the search using the request).
client.assets.select() // (1)
.includeOnResults(Table.COLUMNS) // (2)
.includeOnRelations(Column.NAME) // (3)
.stream() // (4)
...
- Start building a FluentSearch query (in this example from a client, using its 'assets' member's
select()method). - Chain as many
includeOnResultscalls as you like, to include one or more relationships on each search result. - Then chain as many
includeOnRelationscalls as you like. Each method call should include a searchable Atlan field you want to include on each relationship included in each search result. (In this example, every related column that comes back for each search result will include the column's name.) - You can then run the search as you like (in this example, streaming the results directly).
{
"dsl": { // (1)
"query": {
...
},
"from": 0,
"size": 100,
"track_total_hits": true
},
"attributes": [ // (2)
"columns"
],
"relationAttributes": [ // (3)
"name"
]
"suppressLogs": true,
"showSearchScore": false,
"excludeMeanings": false,
"excludeClassifications": false
}
- Define the search query as you normally would.
- Specify the list of attributes (relationships) you want to include on each result in the
attributeslist of the request. - Specify the list of attributes you want to include on each relationship in each search result in the
relationAttributeslist of the request.
It's currently only possible to include details for first-degree attributes and first-degree relationships and their attributes. If you want to see the attributes of related assets' relationships you must run a second search.