public interface SearchCriterion extends Field
Modifier and Type | Method and Description |
---|---|
String |
getId()
Get the SearchCriterion ID.
|
Query.Operator |
getOperator()
Get the criterion Operator.
|
default Query |
getQuery(Object value,
Map<String,Object> allValues,
String language,
Map<String,Object> contextualParameters)
Get the
Query associated to the given value. |
Query |
getQuery(Object value,
Query.Operator customOperator,
Map<String,Object> allValues,
String language,
Map<String,Object> contextualParameters)
Get the
Query associated to the given value. |
SearchField |
getSearchField()
Get the
SearchField representing this search criterion. |
default boolean |
isFacetable()
Test if the criterion can be set as a facet (i.e.
|
static boolean |
isFacetable(MetadataType type,
boolean isEnumerated)
Test if a field is facetable.
|
default boolean |
isSortable()
Test if the SearchCriterion is sortable.
|
static boolean |
isSortable(Field field)
Test if a field is sortable.
|
getContentTypeId, getEnumerator, getType, isMultiple
default boolean isSortable()
true
if the criterion is sortable, false otherwise.static boolean isSortable(Field field)
field
- the field to test.default boolean isFacetable()
static boolean isFacetable(MetadataType type, boolean isEnumerated)
type
- the type of the metadataisEnumerated
- is the metadata enumerated ?Query.Operator getOperator()
default Query getQuery(Object value, Map<String,Object> allValues, String language, Map<String,Object> contextualParameters)
Query
associated to the given value.value
- The user-submitted value (or the default value if not set) for this criterion.allValues
- All the user-submitted values.language
- The current search language.contextualParameters
- the search contextual parameters.Query
associated to the given value.Query getQuery(Object value, Query.Operator customOperator, Map<String,Object> allValues, String language, Map<String,Object> contextualParameters)
Query
associated to the given value.value
- The user-submitted value (or the default value if not set) for this criterion.customOperator
- In advanced search mode, the operator chosen by the user. null
to use the criterion-defined operator (simple search mode).allValues
- All the user-submitted values.language
- The current search language.contextualParameters
- the search contextual parameters.Query
associated to the given value.SearchField getSearchField()
SearchField
representing this search criterion.SearchField
representing this search criterion.