Class Cluster


  • public class Cluster
    extends Object

    A contextual navigation cluster (belongs to a Category).

    For example if the query is "King", a cluster could be "King Richard". It's usually displayed "... Richard" on search results.

    Since:
    11.0
    See Also:
    ContextualNavigation, Category, ClusterNav
    • Field Detail

      • QUERY_PATTERN

        private static final Pattern QUERY_PATTERN
        Pattern used to find the query for this cluster from the query string.
      • href

        private String href
        Link to run a query using this cluster as query terms.
      • count

        private Integer count
        Number of results for this suggestion
      • label

        private String label
        Label of this suggestion (Ex: "... Richard" for the query "King").
      • query

        private String query
        Query term for this suggestion (Ex: "King Richard" for the query "King").
    • Constructor Detail

      • Cluster

        public Cluster()
    • Method Detail

      • setHref

        public void setHref​(String href)
        Sets the href of this suggestion and extracts the query terms into query.
        Parameters:
        href - URL to use for this suggestion.
      • getHref

        public String getHref()
        Link to run a query using this cluster as query terms.
      • getCount

        public Integer getCount()
        Number of results for this suggestion
      • setCount

        public void setCount​(Integer count)
        Number of results for this suggestion
      • getLabel

        public String getLabel()
        Label of this suggestion (Ex: "... Richard" for the query "King").
      • setLabel

        public void setLabel​(String label)
        Label of this suggestion (Ex: "... Richard" for the query "King").
      • getQuery

        public String getQuery()
        Query term for this suggestion (Ex: "King Richard" for the query "King").
      • setQuery

        public void setQuery​(String query)
        Query term for this suggestion (Ex: "King Richard" for the query "King").