Interface Limit<T>

Type Parameters:
T -
All Superinterfaces:
Executor<T>
All Known Subinterfaces:
Filter<T>, OrderByFieldOrLimit<T>, OrderByOperation<T>, Query<T>, ScoredFilter<T>

public interface Limit<T> extends Executor<T>
Limit and execute operations
API:
This is a public API.
  • Method Summary

    Modifier and Type
    Method
    Description
    limit(int size)
    Limits the result to the given size
    limit(int from, int size)
    Limits the result to the given from position and size

    Methods inherited from interface ch.ivyteam.ivy.business.data.store.search.Executor

    execute
  • Method Details

    • limit

      Executor<T> limit(int size)
      Limits the result to the given size

      Example:

       import workflow.business.data.Dossier;
      
       List<Dossier> result = ivy.repo.search(Dossier.class)
           .limit(100)
           .execute()
           .getAll();
       

      If you do not specify a limit then the maximum number of results that are returned is 10.

      The value of parameter size must be smaller than the value of the index setting index.max_result_window (default value is 10000). If you specify a higher value you will receive an error.

      Parameters:
      size - the maximum number of results to return. size must be smaller than index.max_result_window
      Returns:
      execute operation
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • limit

      Executor<T> limit(int from, int size)
      Limits the result to the given from position and size

      Example:

       import workflow.business.data.Dossier;
      
       List<Dossier> result = ivy.repo.search(Dossier.class)
           .limit(900, 100)
           .execute()
           .getAll();
       

      If you do not use a limit method then the maximum number of results that are returned is 10.

      The value of parameter from plus the value of parameter size must be smaller than the value of the index setting index.max_result_window (default value is 10000). If you specify higher values you will receive an error.

      Parameters:
      from - the start index of the first result to return. from+size must be smaller than index.max_result_window
      size - the maximum number of results to return. from+size must be smaller than index.max_result_window
      Returns:
      execute operation
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.