Interface SearchCriterionDefinition

All Known Subinterfaces:
FrontEnumerableSearchCriterionDefinition
All Known Implementing Classes:
AbstractDefaultSearchCriterionDefinition, ContentAttributeContentSearchCriterionDefinition, ContentSearchCriterionDefinition, DegreeUniversityAttributeContentSearchCriterionDefinition, DublinCoreSearchCriterionDefinition, PageSearchCriterionDefinition, PageTitleSearchCriterionDefinition, ResourceFormatSearchCriterionDefinition, SitemapSearchCriterionDefinition, SiteSearchCriterionDefinition, TagSearchCriterionDefinition, TitleOrWordingSearchCriterionDefinition, WordingSearchCriterionDefinition

public interface SearchCriterionDefinition
A potential search criterion proposed to the creator of an instance of search service.
  • Method Details

    • getId

      Gets the id of the criterion. It must be unique across all criterion definitions
      Returns:
      the unique id of the criterion
    • getLabel

      Gets the label of the criterion.
      Returns:
      the label of the criterion.
    • getContextPrefixLabels

      Gets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.
      Returns:
      The prefix labels (can be empty)
    • getSearchable

      Gets the (Searchable) the criterion belongs to.
      Important: if the criterion definition is brought by a specific Searchable, then this searchable must be returned in a non-empty Optional. If the criterion definition is brought by SearchServiceCommonImpls, then an Optional.empty() must be returned.
      Returns:
      the (Searchable) the criterion belongs to.
    • getType

      Gets the type of criterion
      Returns:
      the type of criterion
    • isEnumerated

      boolean isEnumerated()
      Returns true if this criterion definition is enumerated
      Returns:
      true if this criterion definition is enumerated
    • getEnumeratedValues

      Gets the enumerated entries.
      Must be non-empty if isEnumerated() returns true.
      Parameters:
      contextualParameters - The contextual parameters
      Returns:
      the enumerated entries
    • isTooBigForStaticEnumerator

      Returns true if this criterion definition is enumerated but can contains too much data
      Returns:
      true if this criterion definition is enumerated but can contains too much data
    • getWidget

      Gets the widget
      Returns:
      the widget
    • getWidgetParameters

      Gets the widget parameters
      Returns:
      the widget parameters
    • getValidator

      Gets the validator
      Returns:
      the validator
    • toJSON

      Gets the JSON representation of this criterion definition
      Returns:
      the JSON representation of this criterion definition
      Throws:
      Exception - if an exception occurs
    • getQuery

      Query getQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)
      Gets the query associated to the given value
      Parameters:
      value - the value
      operator - the operator
      language - The current search language.
      contextualParameters - the search contextual parameters.
      Returns:
      the query associated to the given value
    • getEmptyValueQuery

      Query getEmptyValueQuery(String language, Map<String,Object> contextualParameters)
      Gets the query for testing the value is empty
      Parameters:
      language - The current search language.
      contextualParameters - the search contextual parameters.
      Returns:
      the query for testing the value is empty