Querying for asset types
4 answers
There is not a documented or supported method to perform such a query. You may use the facets on the search page to see all assets in a single type. However, there is an unsupported way perform the query.
For example, if you wanted to query for all assets in
'type1' or 'type2' or 'Type Three'
The query would be
fType:(type1) OR fType(type2) OR fType(type_three)
Notice for 'Type Three' that it is necessary to lowercase all letters and replace spaces with underscores.
For example, if you wanted to query for all assets in
'type1' or 'type2' or 'Type Three'
The query would be
fType:(type1) OR fType(type2) OR fType(type_three)
Notice for 'Type Three' that it is necessary to lowercase all letters and replace spaces with underscores.
In the spirit of sharing here is my search code using the API to find assets modified in a week timeframe that were NOT of type General Documentation:
RAMAssetQueryBuilder queryBuilder = new RAMAssetQueryBuilder(session);
queryBuilder.setMaxResults(-1);
String query = "_lastModified_:() AND !fType:(general_documentation)";
SearchResult pagedResult = session.getAssets(queryBuilder);
RAMAssetQueryBuilder queryBuilder = new RAMAssetQueryBuilder(session);
queryBuilder.setMaxResults(-1);
String query = "_lastModified_:() AND !fType:(general_documentation)";
SearchResult pagedResult = session.getAssets(queryBuilder);