Package io.goobi.viewer.model.search
Class FacetItem
java.lang.Object
io.goobi.viewer.model.search.FacetItem
- All Implemented Interfaces:
IFacetItem,Serializable
FacetItem class.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for active facets received via the URL.Constructor for active facets received via the URL.FacetItem(org.apache.solr.client.solrj.response.FacetField.Count count) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic List<IFacetItem> generateFacetItems(String field, Map<String, Long> values, boolean sort, boolean reverseOrder, boolean hierarchical) Constructs a list of FilterLink objects for faceting.static List<IFacetItem> generateFilterLinkList(List<IFacetItem> existingFacetsItems, String field, FacetSorting.SortingMap<String, Long> values, boolean hierarchical, int groupToLength, Map<String, String> labelMap) Constructs facet items from the list of given field:value combinations.longgetCount()Getter for the fieldcount.Link after slash/backslash replacements for partner collection, static drill-down components and topic browsing (HU Berlin).getField()Getter for the fieldfield.getFullValue.getLabel()Getter for the fieldlabel.getLink()Getter for the fieldlink.Returns field:value (with the value escaped for the Solr query).Getter for the fieldtranslatedLabel.getType()URL escaped link for using in search drill-downs.getValue()Getter for the fieldvalue.Getter for the fieldvalue2.inthashCode()voidincreaseCount(long amount) booleanbooleanisGroup()booleanisHierarchial.setCount(long count) Setter for the fieldcount.voidSetter for the fieldfield.setGroup(boolean group) Setter for the fieldlabel.voidSetter for the fieldlink.voidsetTranslatedLabel(String translatedLabel) Dummy setter to fulfill the interface contract.voidsetType(FacetItem.FacetType type) voidSetter for the fieldvalue.voidSetter for the fieldvalue2.toString()
-
Constructor Details
-
FacetItem
Constructor for active facets received via the URL. The Solr query is split into individual field/value.- Parameters:
link- aStringobject.hierarchical- a boolean.
-
FacetItem
Constructor for active facets received via the URL. The Solr query is split into individual field/value.- Parameters:
link- aStringobject.label-hierarchical- a boolean.
-
FacetItem
public FacetItem(org.apache.solr.client.solrj.response.FacetField.Count count) - Parameters:
count-
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
generateFilterLinkList
public static List<IFacetItem> generateFilterLinkList(List<IFacetItem> existingFacetsItems, String field, FacetSorting.SortingMap<String, Long> values, boolean hierarchical, int groupToLength, Map<String, String> labelMap) Constructs facet items from the list of given field:value combinations. Always sorted by the label translation.- Parameters:
existingFacetsItems- List of previously generated items (e.g. via other result groups) to combine with new itemsfield- Facet fieldvalues- Map containing facet values and their countshierarchical- true if facet field is hierarchical; false otherwisegroupToLength- If value is greater than 0, facet values will be grouped together by if they contain equal characters at {0-groupByLength}labelMap- Optional map for storing alternate labels for later use by the client- Returns:
ArrayListofFacetItem
-
generateFacetItems
public static List<IFacetItem> generateFacetItems(String field, Map<String, Long> values, boolean sort, boolean reverseOrder, boolean hierarchical) Constructs a list of FilterLink objects for faceting. Optionally sorted by the raw values. -
getQueryEscapedLink
Returns field:value (with the value escaped for the Solr query).- Specified by:
getQueryEscapedLinkin interfaceIFacetItem- Returns:
- a
Stringobject.
-
getEscapedLink
Link after slash/backslash replacements for partner collection, static drill-down components and topic browsing (HU Berlin).- Specified by:
getEscapedLinkin interfaceIFacetItem- Returns:
- a
Stringobject.
-
getUrlEscapedLink
URL escaped link for using in search drill-downs.- Specified by:
getUrlEscapedLinkin interfaceIFacetItem- Returns:
- a
Stringobject.
-
getType
- Specified by:
getTypein interfaceIFacetItem- Returns:
- the type
-
setType
- Parameters:
type- the type to set
-
getField
Getter for the field
field.- Specified by:
getFieldin interfaceIFacetItem- Returns:
- the field
-
setField
Setter for the field
field.- Specified by:
setFieldin interfaceIFacetItem- Parameters:
field- the field to set
-
getFullValue
getFullValue.
- Specified by:
getFullValuein interfaceIFacetItem- Returns:
- Range of value - value2; just value if value2 empty
-
getValue
Getter for the field
value.- Specified by:
getValuein interfaceIFacetItem- Returns:
- the value
-
setValue
Setter for the field
value.- Specified by:
setValuein interfaceIFacetItem- Parameters:
value- the value to set
-
getValue2
Getter for the field
value2.- Specified by:
getValue2in interfaceIFacetItem- Returns:
- the value2
-
setValue2
Setter for the field
value2.- Specified by:
setValue2in interfaceIFacetItem- Parameters:
value2- the value2 to set
-
getLink
Getter for the field
link.- Specified by:
getLinkin interfaceIFacetItem- Returns:
- the link
-
setLink
Setter for the field
link.- Specified by:
setLinkin interfaceIFacetItem- Parameters:
link- the link to set
-
getLabel
Getter for the field
label.- Specified by:
getLabelin interfaceIFacetItem- Returns:
- the label
-
setLabel
Setter for the field
label.- Specified by:
setLabelin interfaceIFacetItem- Parameters:
label- the label to set- Returns:
- this
-
getTranslatedLabel
Getter for the field
translatedLabel.- Specified by:
getTranslatedLabelin interfaceIFacetItem- Returns:
- the translatedLabel
-
setTranslatedLabel
Dummy setter to fulfill the interface contract.- Specified by:
setTranslatedLabelin interfaceIFacetItem- Parameters:
translatedLabel- the translatedLabel to set
-
getCount
public long getCount()Getter for the field
count.- Specified by:
getCountin interfaceIFacetItem- Returns:
- the count
-
setCount
Setter for the field
count.- Specified by:
setCountin interfaceIFacetItem- Parameters:
count- the count to set- Returns:
- this
-
increaseCount
public void increaseCount(long amount) -
isGroup
public boolean isGroup()- Specified by:
isGroupin interfaceIFacetItem
-
setGroup
- Specified by:
setGroupin interfaceIFacetItem
-
isHierarchial
public boolean isHierarchial()isHierarchial.
- Specified by:
isHierarchialin interfaceIFacetItem- Returns:
- the hierarchial
-
isBooleanType
public boolean isBooleanType()- Specified by:
isBooleanTypein interfaceIFacetItem
-
toString
-