Class SearchAssetsRequest


public class SearchAssetsRequest extends PaginatedListRequest<SearchAssetsRequest,AssetSearchResult>
Request class used to search for a content item request based on specific search criteria. Below is an example that searches for items up to 'searchLimit' number of items that match the content type 'searchType' and sorts the results by the 'name' field.
   

 // this shows how to build a search request
 SearchAssetsRequest searchRequest = new SearchAssetsRequest(deliveryClient)
        .limit(20)                 //  maximum results to return
        .sortByField("name")       // field used to sort results
        .type("mycontenttype");    // content type to search for
 
  • Field Details

    • filter

      protected String filter
  • Constructor Details

    • SearchAssetsRequest

      public SearchAssetsRequest(ContentDeliveryClient client)
      Construct request to search for content items.
      Parameters:
      client - Valid delivery client
  • Method Details

    • filter

      public SearchAssetsRequest filter(String filter)
      Specify the search filter to apply when searching for items with a SCIM string. For example: type eq "Blog" would only return items that match a type of "Blog". In general the most common methods for filtering should be provided by methods such as type(java.lang.String), etc. But if a query filter is not provided you can pass in your own as a string. It is recommended to use the helper builder SearchQueryBuilder to construct the string.
      Parameters:
      filter - Search criteria filter
      Returns:
      this
    • type

      public SearchAssetsRequest type(String type)
      Forms a simple filter that searches by type that matches the "type" parameter.
      Parameters:
      type - TypeName to match
      Returns:
      this
    • defaultQuery

      public SearchAssetsRequest defaultQuery(String defaultQuery)
      The "default" query string specified for the REST call
      Parameters:
      defaultQuery - default query string
      Returns:
      this
    • typeList

      public SearchAssetsRequest typeList(List<String> contentTypeList)
      Filter results to list of content types.
      Parameters:
      contentTypeList - list of content type names to filter by
      Returns:
      this
    • idList

      public SearchAssetsRequest idList(List<String> idList)
      Filter results to list of specific ids
      Parameters:
      idList - list of ids to filter by
      Returns:
      this
    • nameList

      public SearchAssetsRequest nameList(List<String> nameList)
      Filter results to list of specific names
      Parameters:
      nameList - list of names to filter by
      Returns:
      this
    • fieldMatchesList

      public SearchAssetsRequest fieldMatchesList(String fieldName, List<String> list)
      Add filter criteria for field and value list. For example, orFieldList("name", {"a","b","c"}) would add a filter in the form of (a OR b OR c)
      Parameters:
      fieldName - field name to match
      list - list of values to use
      Returns:
      this
    • clearFilter

      public SearchAssetsRequest clearFilter()
      Clear all filters.
      Returns:
      this
    • name

      public SearchAssetsRequest name(String name)
      Filter results to specified item name
      Parameters:
      name - Name to search for
      Returns:
      this
    • fieldEquals

      public SearchAssetsRequest fieldEquals(String fieldName, String fieldValue)
      Filter results to specified field equal to the value
      Parameters:
      fieldName - Field name to test
      fieldValue - Field value expected
      Returns:
      this
    • language

      public SearchAssetsRequest language(String language)
      Filter results to specified language
      Parameters:
      language - Language (e.g. "fr", "en-US") filter
      Returns:
      this
    • taxonomyCategoryNodeIds

      public SearchAssetsRequest taxonomyCategoryNodeIds(List<String> nodeIdList)
      Filter results to list of taxonomy category node ids.
      Parameters:
      nodeIdList - list of taxonomy category node ids
      Returns:
      this
    • getCall

      public retrofit2.Call<com.google.gson.JsonElement> getCall()
      Get retrofit call to use for search request
      Specified by:
      getCall in class ContentRequest<SearchAssetsRequest,AssetSearchResult>
      Returns:
      return the retrofit call object to use for this request