Class RequestSearchByText


  • public class RequestSearchByText
    extends RequestBase<Item>
    The RequestSearchByText class returns items filtered by text.

    Request Search By Text is similar to RequestSearchByField. However, in this class, the text will be searched in any of the following fields: title, genre, year, artist, actor and director.

    All fields are equally searched.

    This is the class returned by ContentDiscovery.searchByTextRequest(String) ()} (String)}.

    It has method to execute request synchronously and asynchronously and provides a set of Set methods for parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void executeAsync​(ContentDiscovery.Listener<Item> listener)
      Gets a list of items asynchronously.
      java.util.List<Item> executeSync()
      Gets a list of items synchronously.
      JSONObject getSocketPayload()  
      void setContentType​(java.lang.String contentType)
      Specifies the content type to filter the results.
      void setFilterFields​(java.util.Map<SearchFilter,​java.lang.String> filterFields)
      Specifies the fields to be filtered.

      Example: duration, subtitle, soundtrack, rating and category.
      void setImageResolutions​(java.util.Set<java.lang.String> imageResolutions)
      Returns images, such as posters or synopses, in the specified resolution.
      void setImageSizeSelectors​(java.util.Set<java.lang.Integer> imageSizeSelectors)
      Returns images, such as posters or synopses, in the specified size as defined by the airline.
      void setMatchType​(MatchType matchType)
      Specifies the match type to filter results.
      void setPagination​(PagingOption paging)
      Identifies the pagination parameter for the page offset and page size.
      void setRequestedFields​(java.util.Set<java.lang.String> requestedFields)
      Specifies the fields to be returned.

      Example: Title, genre, year, artist, actor and director.
      void setSeatClass​(java.lang.String seatClass)
      Specifies the seat class, such as first or business.

      If not specified, SeatClass.All will be used.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setContentType

        public void setContentType​(java.lang.String contentType)
        Specifies the content type to filter the results.

        Example: movie, audio and tv series.
        Parameters:
        contentType - Only accepts the strings defined in ContentType.Type
      • setMatchType

        public void setMatchType​(MatchType matchType)
        Specifies the match type to filter results.

        The types of matches are:
        • MatchType.BROAD_MATCH: broad or fuzzy match. Search criteria includes: typo correction, not all words need to exist.

        • MatchType.PHRASE_MATCH: phrase match. Search criteria includes: typo correction, all words need to be included.

        • MatchType.EXACT_MATCH: exact match. Search criteria includes: no typo correction, text needs to be exact.



        The default is MatchType.BROAD_MATCH
        Parameters:
        matchType - Sets the type of match as broad, phrase or exact.
      • setSeatClass

        public void setSeatClass​(java.lang.String seatClass)
        Specifies the seat class, such as first or business.

        If not specified, SeatClass.All will be used.
        Parameters:
        seatClass - Only accepts strings provided by SeatClass, such as first, business or all.
      • setFilterFields

        public void setFilterFields​(java.util.Map<SearchFilter,​java.lang.String> filterFields)
        Specifies the fields to be filtered.

        Example: duration, subtitle, soundtrack, rating and category.

        Parameters:
        filterFields - Specifies the fields to be filtered.
      • setRequestedFields

        public void setRequestedFields​(java.util.Set<java.lang.String> requestedFields)
        Specifies the fields to be returned.

        Example: Title, genre, year, artist, actor and director.

        If this is not set, all fields will be returned.
        Parameters:
        requestedFields - Specifies the fields to be returned.
      • setImageSizeSelectors

        public void setImageSizeSelectors​(java.util.Set<java.lang.Integer> imageSizeSelectors)
        Returns images, such as posters or synopses, in the specified size as defined by the airline.

        When both image_size_selector and image_resolution are present, image_size_selector takes priority.

        If neither are present, all images will be returned.
        Parameters:
        imageSizeSelectors - Specifies the image size.
      • setImageResolutions

        public void setImageResolutions​(java.util.Set<java.lang.String> imageResolutions)
        Returns images, such as posters or synopses, in the specified resolution. Format is widthxheight, such as "800x600".

        When both image_size_selector and image_resolution are present, image_size_selector takes priority.

        If neither are present, all images will be returned.
        Parameters:
        imageResolutions - Specifies the image resolution.
      • setPagination

        public void setPagination​(PagingOption paging)
        Identifies the pagination parameter for the page offset and page size.

        The offset sets the number of items to skip in the result. The default is 0 items to skip.

        If this offset is negative, 0 will be used.

        If the offset is greater than the total amount of the matched data, nothing will be returned.

        The page size sets the maximum number of items to return in the result. The default is 150 items. For example: offset=60&page_size=15 - The first 60 items will be skipped. The items 61 to 75 will be returned, if available.
        Parameters:
        paging - pagination