Class SearchFacets

    • Constructor Detail

      • SearchFacets

        public SearchFacets()
    • Method Detail

      • resetAvailableFacets

        public void resetAvailableFacets()

        resetAvailableFacets.

      • resetCurrentFacets

        public void resetCurrentFacets()

        resetCurrentFacets.

      • resetSliderRange

        public void resetSliderRange()

        resetSliderRange.

      • generateFacetFilterQueries

        public List<String> generateFacetFilterQueries​(boolean includeRangeFacets)
        Generates a list containing filter queries for the selected regular and hierarchical facets.
        Parameters:
        advancedSearchGroupOperator - a int.
        includeRangeFacets - a boolean.
        Returns:
        a List object.
      • getCurrentFacetForField

        public IFacetItem getCurrentFacetForField​(String field)
        Returns the first FacetItem objects in currentFacets where the field name matches the given field name.
        Parameters:
        field - The field name to match.
        Returns:
        a FacetItem object.
      • getCurrentFacetsForField

        public List<IFacetItem> getCurrentFacetsForField​(String field)
        Returns a list of FacetItem objects in currentFacets where the field name matches the given field name.
        Parameters:
        field - The field name to match.
        Returns:
        a List object.
      • isFacetCurrentlyUsed

        public boolean isFacetCurrentlyUsed​(IFacetItem facet)
        Checks whether the given facet is currently in use.
        Parameters:
        facet - The facet to check.
        Returns:
        a boolean.
      • isFacetListSizeSufficient

        public boolean isFacetListSizeSufficient​(String field)

        isFacetListSizeSufficient.

        Parameters:
        field - a String object.
        Returns:
        a boolean.
      • getAvailableFacetsListSizeForField

        public int getAvailableFacetsListSizeForField​(String field)
        Returns the size of the full element list of the facet for the given field.
        Parameters:
        field - a String object.
        Returns:
        a int.
      • getCurrentFacetsSizeForField

        public int getCurrentFacetsSizeForField​(String field)

        getCurrentFacetsSizeForField.

        Parameters:
        field - a String object.
        Returns:
        Size of currentFacets.
      • getLimitedFacetListForField

        public List<IFacetItem> getLimitedFacetListForField​(String field)
        Returns a collapsed sublist of the available facet elements for the given field.
        Parameters:
        field - a String object.
        Returns:
        a List object.
      • getFacetElementDisplayNumber

        @Deprecated
        public int getFacetElementDisplayNumber​(String field)
        Deprecated.
        Check whether still in use
        If the facet for given field is expanded, return the size of the facet, otherwise the initial (collapsed) number of elements as configured.
        Parameters:
        field - a String object.
        Returns:
        a int.
      • expandFacet

        public void expandFacet​(String field)
        Sets the expanded flag to true for the given facet field.
        Parameters:
        field - a String object.
      • collapseFacet

        public void collapseFacet​(String field)
        Sets the expanded flag to false for the given facet field.
        Parameters:
        field - a String object.
      • isDisplayFacetExpandLink

        public boolean isDisplayFacetExpandLink​(String field)
        Returns true if the "(more)" link is to be displayed for a facet box. This is the case if the facet has more elements than the initial number of displayed elements and the facet hasn't been manually expanded yet.
        Parameters:
        field - a String object.
        Returns:
        a boolean.
      • isDisplayFacetCollapseLink

        public boolean isDisplayFacetCollapseLink​(String field)

        isDisplayFacetCollapseLink.

        Parameters:
        field - a String object.
        Returns:
        a boolean.
      • getCurrentFacetString

        public String getCurrentFacetString()
        Returns a URL encoded SSV string of facet fields and values from the elements in currentFacets (hyphen if empty).
        Returns:
        SSV string of facet queries or "-" if empty
      • getCurrentFacetString

        public String getCurrentFacetString​(boolean urlEncode)

        getCurrentFacetString.

        Parameters:
        urlEncode - a boolean.
        Returns:
        a String object.
      • setCurrentFacetString

        public void setCurrentFacetString​(String currentFacetString)
        Receives an SSV string of facet fields and values (FIELD1:value1;FIELD2:value2;FIELD3:value3) and generates new Elements for currentFacets.
        Parameters:
        currentFacetString - a String object.
      • updateFacetItem

        public String updateFacetItem​(String field,
                                      boolean hierarchical)
        Updates existing facet item for the given field with a new value. If no item for that field yet exist, a new one is added.
        Parameters:
        field - a String object.
        hierarchical - a boolean.
        Returns:
        a String object.
      • getHierarchicalFacets

        public static List<String> getHierarchicalFacets​(String facetString,
                                                         List<String> facetFields)

        getHierarchicalFacets.

        Parameters:
        facetString - a String object.
        facetFields - a List object.
        Returns:
        a List object.
      • splitHierarchicalFacet

        public static List<String> splitHierarchicalFacet​(String facet)

        splitHierarchicalFacet.

        Parameters:
        facet - a String object.
        Returns:
        a List object.
      • resetCurrentFacetString

        public void resetCurrentFacetString()

        resetCurrentFacetString.

      • getCurrentFacetStringPrefix

        public String getCurrentFacetStringPrefix()
        Returns a URL encoded value returned by generateFacetPrefix() for regular facets. Returns an empty string instead a hyphen if empty.
        Returns:
        a String object.
      • getCurrentFacetStringPrefix

        public String getCurrentFacetStringPrefix​(boolean urlEncode)
        Returns the value returned by generateFacetPrefix() for regular facets. Returns an empty string instead a hyphen if empty.
        Parameters:
        urlEncode -
        Returns:
      • removeFacetAction

        public String removeFacetAction​(String facetQuery,
                                        String ret)

        removeFacetAction.

        Parameters:
        facetQuery - a String object.
        ret - a String object.
        Returns:
        a String object.
      • isFacetExpanded

        public boolean isFacetExpanded​(String field)
        Returns true if the value for the given field type in facetsExpanded has been previously set to true.
        Parameters:
        field - a String object.
        Returns:
        a boolean.
      • isFacetCollapsed

        public boolean isFacetCollapsed​(String field)

        isFacetCollapsed.

        Parameters:
        field - a String object.
        Returns:
        a boolean.
      • getAllAvailableFacets

        public Map<String,​List<IFacetItem>> getAllAvailableFacets()

        getAllAvailableFacets.

        Returns:
        a Map object.
      • getConfiguredSubelementFacetFields

        public List<String> getConfiguredSubelementFacetFields()

        getConfiguredSubelementFacetFields.

        Returns:
        Configured subelement fields names only
      • getAvailableFacets

        public Map<String,​List<IFacetItem>> getAvailableFacets()

        Getter for the field availableFacets.

        Returns:
        the availableFacets
      • getCurrentFacets

        public List<IFacetItem> getCurrentFacets()

        Getter for the field currentFacets.

        Returns:
        the currentFacets
      • getTempValue

        public String getTempValue()

        Getter for the field tempValue.

        Returns:
        the tempValue
      • setTempValue

        public void setTempValue​(String tempValue)

        Setter for the field tempValue.

        Parameters:
        tempValue - the tempValue to set
      • isHasWrongLanguageCode

        public boolean isHasWrongLanguageCode​(String field,
                                              String language)
        Returns true if the given field is language-specific to a different language than the given language.
        Parameters:
        field - a String object.
        language - a String object.
        Returns:
        a boolean.
      • getFacetValue

        public String getFacetValue​(String field)

        getFacetValue.

        Parameters:
        field - a String object.
        Returns:
        a String object.
      • getFacetDescription

        public String getFacetDescription​(String field)

        getFacetDescription.

        Parameters:
        field - a String object.
        Returns:
        a String object.
      • getFirstHierarchicalFacetValue

        public String getFirstHierarchicalFacetValue()

        getFirstHierarchicalFacetValue.

        Returns:
        a String object.
      • getFirstHierarchicalFacetDescription

        public String getFirstHierarchicalFacetDescription​(String field)

        getFirstHierarchicalFacetDescription.

        Parameters:
        field - a String object.
        Returns:
        a String object.
      • getLabelMap

        public Map<String,​String> getLabelMap()
        Returns:
        the labelMap
      • getGeoFacetting

        public GeoFacetItem getGeoFacetting()
        Returns:
        the geoFacetting
      • setGeoFacetFeature

        public void setGeoFacetFeature​(String feature)
        Sets the feature of the geoFacettingfield to to given feature. A new GeoFacetItem is added to currentFacets if none exists yet
        Parameters:
        feature -
      • getGeoFacetFeature

        public String getGeoFacetFeature()