Class EntityCollectionParameters
java.lang.Object
com.loop54.model.request.parameters.EntityCollectionParameters
This class specifies how a collection of entities should be paged, filtered, sorted and faceted.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of facets to calculate and possibly filter the result on.How the results should be filtered.How many entities to skip when paging the result.List of sorting parameters specifying how the result should be sorted.How many entities to take when paging the result. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDistinctFacet(String attributeName) Adds a facet with the typeFacetType.DISTINCTto the entity collection parameter.voidaddDistinctFacet(String attributeName, List<?> selected) Adds a facet with the typeFacetType.DISTINCTto the entity collection parameter.voidaddDistinctFacet(String attributeName, List<?> selected, String name, List<DistinctFacetItemSortingParameter> sortBy) Adds a facet with the typeFacetType.DISTINCTto the entity collection parameter.voidaddRangeFacet(String attributeName) Adds a facet with the typeFacetType.RANGEto the entity collection parameter.voidaddRangeFacet(String attributeName, RangeFacetParameter.RangeFacetSelectedParameter<?> selected, String name) Adds a facet with the typeFacetType.RANGEto the entity collection parameter.
-
Field Details
-
skip
How many entities to skip when paging the result. If null it defaults to 0. -
take
How many entities to take when paging the result. If null it defaults to 5. -
sortBy
List of sorting parameters specifying how the result should be sorted. The first sorting parameter specifies the primary order. If items are equal, they will be sorted using the second parameter, and so on. If not set the entities will be sorted by relevance descending. -
facets
List of facets to calculate and possibly filter the result on. If not set, no faceting is done. -
filter
How the results should be filtered. If not set, no filtering is done.
-
-
Constructor Details
-
EntityCollectionParameters
public EntityCollectionParameters()
-
-
Method Details
-
addDistinctFacet
Adds a facet with the typeFacetType.DISTINCTto the entity collection parameter.- Parameters:
attributeName- What attribute on the entities to facet on. This must match one of the attributes available on the entities in the search engine.
-
addDistinctFacet
Adds a facet with the typeFacetType.DISTINCTto the entity collection parameter.- Parameters:
attributeName- What attribute on the entities to facet on. This must match one of the attributes available on the entities in the search engine.selected- Values selected by the user. If none are selected this can be null.
-
addDistinctFacet
public void addDistinctFacet(String attributeName, List<?> selected, String name, List<DistinctFacetItemSortingParameter> sortBy) Adds a facet with the typeFacetType.DISTINCTto the entity collection parameter.- Parameters:
attributeName- What attribute on the entities to facet on. This must match one of the attributes available on the entities in the search engine.selected- Values selected by the user. If none are selected this can be null.name- The desired name of the facet in the response. Will be the same as the attributeName if null.sortBy- How to sort the facet options in the response.
-
addRangeFacet
Adds a facet with the typeFacetType.RANGEto the entity collection parameter.- Parameters:
attributeName- What attribute on the entities to facet on. This must match one of the attributes available on the entities in the search engine.
-
addRangeFacet
public void addRangeFacet(String attributeName, RangeFacetParameter.RangeFacetSelectedParameter<?> selected, String name) Adds a facet with the typeFacetType.RANGEto the entity collection parameter.- Parameters:
attributeName- What attribute on the entities to facet on. This must match one of the attributes available on the entities in the search engine.selected- The min and max values selected by the user. Can be left to null if nothing is selected.name- The desired name of the facet in the response. Will be the same as the attributeName if null.
-