Interface SearchCriterionDefinition
-
- All Known Subinterfaces:
FrontEnumerableSearchCriterionDefinition
- All Known Implementing Classes:
AbstractDefaultSearchCriterionDefinition,ContentAttributeContentSearchCriterionDefinition,ContentSearchCriterionDefinition,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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default List<I18nizableText>getContextPrefixLabels()Gets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.QuerygetEmptyValueQuery(String language, Map<String,Object> contextualParameters)Gets the query for testing the value is emptyOptional<EnumeratedValues>getEnumeratedValues(Map<String,Object> contextualParameters)Gets the enumerated entries.StringgetId()Gets the id of the criterion.I18nizableTextgetLabel()Gets the label of the criterion.QuerygetQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)Gets the query associated to the given valueOptional<Searchable>getSearchable()Gets the (Searchable) the criterion belongs to.MetadataTypegetType()Gets the type of criterionValidatorgetValidator()Gets the validatorStringgetWidget()Gets the widgetMap<String,I18nizableText>getWidgetParameters()Gets the widget parametersbooleanisEnumerated()Returnstrueif this criterion definition is enumeratedbooleanisTooBigForStaticEnumerator()Returnstrueif this criterion definition is enumerated but can contains too much dataMap<String,Object>toJSON()Gets the JSON representation of this criterion definition
-
-
-
Method Detail
-
getId
String getId()
Gets the id of the criterion. It must be unique across all criterion definitions- Returns:
- the unique id of the criterion
-
getLabel
I18nizableText getLabel()
Gets the label of the criterion.- Returns:
- the label of the criterion.
-
getContextPrefixLabels
default List<I18nizableText> 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
Optional<Searchable> 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
MetadataType getType()
Gets the type of criterion- Returns:
- the type of criterion
-
isEnumerated
boolean isEnumerated()
Returnstrueif this criterion definition is enumerated- Returns:
trueif this criterion definition is enumerated
-
getEnumeratedValues
Optional<EnumeratedValues> getEnumeratedValues(Map<String,Object> contextualParameters)
- Parameters:
contextualParameters- The contextual parameters- Returns:
- the enumerated entries
-
isTooBigForStaticEnumerator
boolean isTooBigForStaticEnumerator()
Returnstrueif this criterion definition is enumerated but can contains too much data- Returns:
trueif this criterion definition is enumerated but can contains too much data
-
getWidgetParameters
Map<String,I18nizableText> getWidgetParameters()
Gets the widget parameters- Returns:
- the widget parameters
-
getValidator
Validator getValidator()
Gets the validator- Returns:
- the validator
-
toJSON
Map<String,Object> toJSON() throws Exception
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
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
-
-