Class EntityCollectionParameters

java.lang.Object
com.loop54.model.request.parameters.EntityCollectionParameters

public class EntityCollectionParameters extends Object
This class specifies how a collection of entities should be paged, filtered, sorted and faceted.
  • Field Details

    • skip

      public Integer skip
      How many entities to skip when paging the result. If null it defaults to 0.
    • take

      public Integer take
      How many entities to take when paging the result. If null it defaults to 5.
    • sortBy

      public List<EntitySortingParameter> 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

      public List<FacetParameter> facets
      List of facets to calculate and possibly filter the result on. If not set, no faceting is done.
    • filter

      public FilterParameter filter
      How the results should be filtered. If not set, no filtering is done.
  • Constructor Details

    • EntityCollectionParameters

      public EntityCollectionParameters()
  • Method Details

    • addDistinctFacet

      public void addDistinctFacet(String attributeName)
      Adds a facet with the type FacetType.DISTINCT to 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

      public void addDistinctFacet(String attributeName, List<?> selected)
      Adds a facet with the type FacetType.DISTINCT to 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 type FacetType.DISTINCT to 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

      public void addRangeFacet(String attributeName)
      Adds a facet with the type FacetType.RANGE to 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 type FacetType.RANGE to 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.