Class SearchContext

java.lang.Object
io.jmix.search.searching.SearchContext

public class SearchContext extends Object
  • Field Details

    • size

      protected int size
    • offset

      protected int offset
    • searchText

      protected final String searchText
    • entities

      protected List<String> entities
  • Constructor Details

    • SearchContext

      public SearchContext(String searchText)
  • Method Details

    • getSize

      public int getSize()
      Gets max amount of documents in result set.
      Returns:
      Size
    • setSize

      public SearchContext setSize(int size)
      Sets max amount of documents in result set.
      Parameters:
      size - Size. Must be positive
      Returns:
      Current SearchContext
    • getOffset

      public int getOffset()
      Gets amount of documents to skip within search.
      Returns:
      Offset
    • setOffset

      public SearchContext setOffset(int offset)
      Sets amount of documents to skip within search.
      Parameters:
      offset - Offset. Must be positive
      Returns:
      Current SearchContext
    • getSearchText

      public String getSearchText()
      Gets text that should be found.
      Returns:
      Search text
    • setEntities

      public SearchContext setEntities(List<String> entities)
      Sets names of entities to search within. Empty list means all indexed entities.
      Parameters:
      entities - List of entity names
      Returns:
      Current SearchContext
    • setEntities

      public SearchContext setEntities(String... entities)
      Sets names of entities to search within. Empty list means all indexed entities.
      Parameters:
      entities - List of entity names
      Returns:
      Current SearchContext
    • getEntities

      public List<String> getEntities()
      Gets names of entities to search within. Empty list means all indexed entities.
      Returns:
      List of entity names
    • toString

      public String toString()
      Overrides:
      toString in class Object