Class FacetDefinition
- java.lang.Object
-
- io.vertigo.core.node.definition.AbstractDefinition
-
- io.vertigo.datafactory.collections.definitions.FacetDefinition
-
- All Implemented Interfaces:
io.vertigo.core.node.definition.Definition
public final class FacetDefinition extends io.vertigo.core.node.definition.AbstractDefinitionDéfinition de Facette. Une facette porte sur un champ donné de l'index. On distingue deux types de facettes. - celles remontant les terms d'un champ - celles remontant les valeurs d'une facette discrétisée par une liste de segments. Une facette - est identifiés par un nom unique au sein de son index. - posséde un Titre. Exemple : Pour une liste d'articles, on créera des définitions de facette - pour segmenter les prix, . 0-10€ . 10-50€ . >50€ - pour donner les principaux fabricants, (facette de type 'term') - etc..- Author:
- pchretien
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFacetDefinition.FacetOrderFacet order : alpha, count, definition
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FacetDefinitioncreateCustomFacetDefinition(String name, io.vertigo.datamodel.structure.definitions.DtField dtField, io.vertigo.core.locale.MessageText label, Map<String,String> customParams, FacetDefinition.FacetOrder order)Creates a new facetDefinition of type 'term'.static FacetDefinitioncreateFacetDefinitionByRange(String name, io.vertigo.datamodel.structure.definitions.DtField dtField, io.vertigo.core.locale.MessageText label, List<FacetValue> facetValues, boolean multiSelectable, FacetDefinition.FacetOrder order)Creates a new facetDefinition of type 'range'.static FacetDefinitioncreateFacetDefinitionByTerm(String name, io.vertigo.datamodel.structure.definitions.DtField dtField, io.vertigo.core.locale.MessageText label, boolean multiSelectable, FacetDefinition.FacetOrder order)Creates a new facetDefinition of type 'term'.Map<String,String>getCustomParams()io.vertigo.datamodel.structure.definitions.DtFieldgetDtField()Ce champ est nécessairement inclus dans l'index.List<FacetValue>getFacetRanges()io.vertigo.core.locale.MessageTextgetLabel()FacetDefinition.FacetOrdergetOrder()booleanisCustomFacet()booleanisMultiSelectable()booleanisRangeFacet()
-
-
-
Field Detail
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
createFacetDefinitionByRange
public static FacetDefinition createFacetDefinitionByRange(String name, io.vertigo.datamodel.structure.definitions.DtField dtField, io.vertigo.core.locale.MessageText label, List<FacetValue> facetValues, boolean multiSelectable, FacetDefinition.FacetOrder order)
Creates a new facetDefinition of type 'range'. A range facet is defined by a list of filters. Examples : [0 -10[ [0-100[ [100-*[- Parameters:
name- the name of the facetdtField- the field of the facetlabel- the label of the facetfacetValues- the list of filtersmultiSelectable- Can select multiple valuesorder- Facet Order- Returns:
- new facetDefinition of type 'range'
-
createFacetDefinitionByTerm
public static FacetDefinition createFacetDefinitionByTerm(String name, io.vertigo.datamodel.structure.definitions.DtField dtField, io.vertigo.core.locale.MessageText label, boolean multiSelectable, FacetDefinition.FacetOrder order)
Creates a new facetDefinition of type 'term'.- Parameters:
name- the name of the facetdtField- the field of the facetlabel- the label of the facetmultiSelectable- Can select multiple valuesorder- Facet Order- Returns:
- new facetDefinition of type 'term'
-
createCustomFacetDefinition
public static FacetDefinition createCustomFacetDefinition(String name, io.vertigo.datamodel.structure.definitions.DtField dtField, io.vertigo.core.locale.MessageText label, Map<String,String> customParams, FacetDefinition.FacetOrder order)
Creates a new facetDefinition of type 'term'.- Parameters:
name- the name of the facetdtField- the field of the facetlabel- the label of the facetmultiSelectable- Can select multiple valuesorder- Facet Order- Returns:
- new facetDefinition of type 'term'
-
getLabel
public io.vertigo.core.locale.MessageText getLabel()
- Returns:
- the label of the facet
-
getDtField
public io.vertigo.datamodel.structure.definitions.DtField getDtField()
Ce champ est nécessairement inclus dans l'index.- Returns:
- Champ sur lequel porte la facette
-
getFacetRanges
public List<FacetValue> getFacetRanges()
- Returns:
- Liste des sélections/range.
-
isCustomFacet
public boolean isCustomFacet()
- Returns:
- if the facet is of type 'custom'
-
isRangeFacet
public boolean isRangeFacet()
- Returns:
- if the facet is of type 'range'
-
isMultiSelectable
public boolean isMultiSelectable()
- Returns:
- if the facet is multiSelectable
-
getOrder
public FacetDefinition.FacetOrder getOrder()
- Returns:
- facet order
-
-