DC 5.10 SDK Asset search

In the following we show how you can fetch and search for assets.

  1. Get a single asset by assetId
    Use the Digizuite service IAssetSearchService

    var assetSearchService = serviceProvider.GetRequiredService<IAssetSearchService>(); var assetResponse = await assetSearchService.GetAsset(75);

    The response model can be found at DC 5.10 Getting assets by Id

     

  2. Get a list of assets
    Use the Digizuite service IAssetSearchService

    var assetSearchService = serviceProvider.GetRequiredService<IAssetSearchService>(); var getAssetsRequest = new GetAssetsRequest { AssetIds = new HashSet<int> { 75, 76 } }; var assetResponse = await assetSearchService.GetAssets(getAssetsRequest);

    The response model can be found at DC 5.10 Getting assets by Id

  3. Freetext search for assets and sort by assetId desending
    Use the Digizuite service IAssetSearchService
    Here we search for assets with the following search criteria:
    Freetext.
    Count, the number of assets pr page.
    Skip, set to 0, which is page 1.
    SortBy, here we sort by the highest assetId.

    var assetSearchService = serviceProvider.GetRequiredService<IAssetSearchService>(); var assetSearchRequestFreetext = new AssetSearchRequest() { FreeText = "Test", Count = 12, Skip = 0, SortBy = new List<SortField> { new SortField { Order = SortOrder.Descending, SearchKey = "assetId" } } }; var assetResponse = await assetSearchService.SearchForAssets(assetSearchRequestFreetext);

     

  4. Search by assettype
    Use the Digizuite service IAssetSearchService
    Search for a specific assettype InDesign.

     

  5. Search by metafield Folders
    Use the Digizuite service IAssetSearchService
    The searchKey is the guid of the metafield Folders. The Folder metafield is of type tree.
    The values, are the tree nodes id’s of the metafield Folder.

     

  6. Search by date range
    Use the Digizuite service IAssetSearchService
    Search assets that has been uploaded in a specific date range.

     

  7. Get all assets in a channel
    If you need to get all assets in a channel and the channel contains more then 10.000 assets, then it has to be requested in a special way. Our search engine elastic has a limitation of 10.000.