Skip to content

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 ensure the search gives you back exactly the information you require:

Including asset properties

1.4.0 1.1.0

You can specify any properties of an asset you want to include in each search result, including relationships:

Include asset properties
1
2
3
4
5
6
Atlan.getDefaultClient.assets.select() // (1)
    .includeOnResults(Table.CREATE_TIME) // (2)
    .includeOnResults(Table.UPDATE_TIME)
    .includeOnResults(Table.COLUMNS)
    .stream() // (3)
    ...
  1. Start building a FluentSearch query (in this example from a client, using its 'assets' member's select() method).
  2. Chain as many includeOnResults calls 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.)
  3. You can then run the search as you like (in this example, streaming the results directly).
Include asset properties
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)
  1. Start building a FluentSearch query (in this example using its select() method directly).
  2. Chain as many include_on_results calls 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.)
  3. You can then run the search as you like (in this example, converting to a request and running the search using the request).
Include asset properties
1
2
3
4
5
6
Atlan.getDefaultClient.assets.select() // (1)
    .includeOnResults(Table.CREATE_TIME) // (2)
    .includeOnResults(Table.UPDATE_TIME)
    .includeOnResults(Table.COLUMNS)
    .stream() // (3)
    ...
  1. Start building a FluentSearch query (in this example from a client, using its 'assets' member's select() method).
  2. Chain as many includeOnResults calls 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.)
  3. You can then run the search as you like (in this example, streaming the results directly).
POST /api/meta/search/indexsearch
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
  "dsl": { // (1)
    "query": {
      ...
    },
    "from": 0,
    "size": 100,
    "track_total_hits": true
  },
  "attributes": [ // (2)
    "createTime",
    "updateTime",
    "columns"
  ],
  "suppressLogs": true,
  "showSearchScore": false,
  "excludeMeanings": false,
  "excludeClassifications": false
}
  1. Define the search query as you normally would.
  2. Specify the list of attributes you want to include on each result in the attributes list of the request.

Including relationship properties

1.4.0 1.1.0

You can also specify which attributes you want to include on each relationship in each search result:

Include relationship properties
1
2
3
4
5
Atlan.getDefaultClient.assets.select() // (1)
    .includeOnResults(Table.COLUMNS) // (2)
    .includeOnRelations(Column.NAME) // (3)
    .stream() // (4)
    ...
  1. Start building a FluentSearch query (in this example from a client, using its 'assets' member's select() method).
  2. Chain as many includeOnResults calls as you like, to include one or more relationships on each search result.
  3. Then chain as many includeOnRelations calls 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.)
  4. You can then run the search as you like (in this example, streaming the results directly).
Include relationship properties
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)
  1. Start building a FluentSearch query (in this example using its select() method directly).
  2. Chain as many include_on_results calls as you like, to include one or more relationships on each search result.
  3. Then chain as many include_on_relations calls 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.)
  4. You can then run the search as you like (in this example, converting to a request and running the search using the request).
Include asset properties
1
2
3
4
5
Atlan.getDefaultClient.assets.select() // (1)
    .includeOnResults(Table.COLUMNS) // (2)
    .includeOnRelations(Column.NAME) // (3)
    .stream() // (4)
    ...
  1. Start building a FluentSearch query (in this example from a client, using its 'assets' member's select() method).
  2. Chain as many includeOnResults calls as you like, to include one or more relationships on each search result.
  3. Then chain as many includeOnRelations calls 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.)
  4. You can then run the search as you like (in this example, streaming the results directly).
POST /api/meta/search/indexsearch
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
  "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
}
  1. Define the search query as you normally would.
  2. Specify the list of attributes (relationships) you want to include on each result in the attributes list of the request.
  3. Specify the list of attributes you want to include on each relationship in each search result in the relationAttributes list of the request.