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 Summary
Modifier and TypeMethodDescriptiondefault List<I18nizableText>
Gets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.getEmptyValueQuery
(String language, Map<String, Object> contextualParameters) Gets the query for testing the value is emptygetEnumeratedValues
(Map<String, Object> contextualParameters) Gets the enumerated entries.getId()
Gets the id of the criterion.getLabel()
Gets the label of the criterion.getQuery
(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Gets the query associated to the given valueGets the (Searchable
) the criterion belongs to.getType()
Gets the type of criterionGets the validatorGets the widgetGets the widget parametersboolean
Returnstrue
if this criterion definition is enumeratedboolean
Returnstrue
if this criterion definition is enumerated but can contains too much datatoJSON()
Gets the JSON representation of this criterion definition
-
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-emptyOptional
. If the criterion definition is brought bySearchServiceCommonImpls
, then anOptional.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()Returnstrue
if this criterion definition is enumerated- Returns:
true
if this criterion definition is enumerated
-
getEnumeratedValues
- Parameters:
contextualParameters
- The contextual parameters- Returns:
- the enumerated entries
-
isTooBigForStaticEnumerator
boolean isTooBigForStaticEnumerator()Returnstrue
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 valueoperator
- the operatorlanguage
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- the query associated to the given value
-
getEmptyValueQuery
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
-