Package org.ametys.cms.search.model
Interface SearchCriterion
- All Superinterfaces:
Field
- All Known Subinterfaces:
IndexingFieldSearchCriterion
,SearchUICriterion
,SystemSearchCriterion
- All Known Implementing Classes:
AbstractCustomSearchUICriterion
,AbstractSearchUICriterion
,CompatibleRegimesSearchUICriteria
,ContentPrivacySearchUICriterion
,DefaultSolrFilterSearchUICriterion
,DynamicWrappedSearchUIModel.WrappedSearchUICriterion
,IndexingFieldAggregatorSearchUICriterion
,IndexingFieldSearchUICriterion
,ODFContributorOrManagerSearchUICriteria
,PageSearchUICriterion
,ProgramItemContextSearchUICriteria
,ShareableCoursePartSearchUICriteria
,ShareableCourseSearchUICriteria
,SolrFilterSearchUICriterion
,SystemSearchUICriterion
Represents a Field that can be searched on.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the description.getId()
Get the SearchCriterion ID.getLabel()
Retrieves the label.Get the criterion Operator.default Query
getQuery
(Object value, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.getQuery
(Object value, Query.Operator customOperator, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.Get theSearchField
representing this search criterion.default boolean
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
Test if the SearchCriterion is sortable.static boolean
isSortable
(Field field) Test if a field is sortable.Methods inherited from interface org.ametys.cms.search.model.Field
getContentTypeId, getEnumerator, getType, isMultiple
-
Method Details
-
getId
Get the SearchCriterion ID.- Returns:
- the SearchCriterion ID.
-
getLabel
Retrieves the label.- Returns:
- the label.
-
getDescription
Retrieves the description.- Returns:
- the description.
-
isSortable
Test if the SearchCriterion is sortable.- Returns:
true
if the criterion is sortable, false otherwise.
-
isSortable
Test if a field is sortable.- Parameters:
field
- the field to test.- Returns:
- true if the field is sortable, false otherwise.
-
isFacetable
Test if the criterion can be set as a facet (i.e. it has a defined list of discrete values).- Returns:
- true if the criterion can be set as a facet, false otherwise.
-
isFacetable
Test if a field is facetable.- Parameters:
type
- the type of the metadataisEnumerated
- is the metadata enumerated ?- Returns:
- true if the field can be used as a facet, false otherwise.
-
getOperator
Get the criterion Operator.- Returns:
- the criterion Operator.
-
getQuery
default Query getQuery(Object value, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.- Parameters:
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.- Returns:
Query
associated to the given value.
-
getQuery
Query getQuery(Object value, Query.Operator customOperator, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.- Parameters:
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.- Returns:
Query
associated to the given value.
-
getSearchField
Get theSearchField
representing this search criterion.- Returns:
- the
SearchField
representing this search criterion.
-