Interface SearchConfig


  • @ConsumerType
    public interface SearchConfig
    Class that represents the overarching Search configuration that may span across components. These methods return the default values set by the Search Results component itself. This class should not take into account HTTP-provided parameters, but rather deal directly with the resource content.
    • Method Detail

      • getSearchResource

        default org.apache.sling.api.resource.Resource getSearchResource()
        Returns:
        the resource that represents the Search Component resource.
      • getProperties

        org.apache.sling.api.resource.ValueMap getProperties()
        Returns:
        a value map for the search results component.
      • getMode

        String getMode()
        The mode derived from the request and if unavailable, then from the configured component state.
        Returns:
        the active search mode (ex. search, browse).
      • getLayout

        String getLayout()
        The layout derived from the request and if unavailable, then from the configured component state.
        Returns:
        the active layout mode (ex. card, list)
      • getPaths

        List<String> getPaths()
        Returns:
        a list of the paths that are eligible for searching.
      • getOrderBy

        String getOrderBy()
        Returns:
        the active order by property value.
      • getOrderBySort

        String getOrderBySort()
        Returns:
        the active order by sort direction.
      • isOrderByCase

        default boolean isOrderByCase()
        Note that ordering case-insensitive with QueryBuilder breaks sorting by anything by text data, so be CAREFUL when implementing this method.
        Returns:
        true if the sort order is case-sensitive, else false;
      • getLimit

        int getLimit()
        Returns:
        the limit of number of results to return for this search.
      • getGuessTotal

        String getGuessTotal()
        Returns:
        the configured Guess Total.
      • getSearchProviderId

        String getSearchProviderId()
        Returns:
        the default
      • getSearchPredicatesNames

        default List<String> getSearchPredicatesNames()
        Returns:
        a list of search predicate names, as configured on the search results component.