Interface SearchEngine.ForType<T>

Type Parameters:
T - type of searchable objects
Enclosing interface:
SearchEngine

public static interface SearchEngine.ForType<T>
Search and index api.
Since:
2.23.0
  • Method Details

    • withIndex

      SearchEngine.ForType<T> withIndex(String name)
      Name of the index which should be used. If not specified the default index will be used.
      Parameters:
      name - name of index
      Returns:
      this
    • forResource

      SearchEngine.ForType<T> forResource(String resource)
      Apply a lock for a specific resource. By default, a lock for the whole index is used. If one or more specific resources are locked, then the lock is applied only for those resources and tasks which target other resources of the same index can run in parallel.
      Parameters:
      resource - specific resource to lock
      Returns:
      this
    • forResource

      default SearchEngine.ForType<T> forResource(ModelObject resource)
      This method is a shortcut for forResource(String) with the id of the given resource.
      Parameters:
      resource - resource in form of model object
      Returns:
      this
    • update

      void update(SerializableIndexTask<T> task)
      Submits a task to update the index. The task is executed asynchronously and will finish at some unknown point in the future. Note: the task must be serializable because it is submitted to the CentralWorkQueue, for more information about the task serialization have a look at the CentralWorkQueue documentation.
      Parameters:
      task - serializable task for updating the index
    • update

      void update(Class<? extends IndexTask<T>> task)
      Submits a task to update the index. The task is executed asynchronous and will be finished some time in the future.
      Parameters:
      task - task for updating multiple indices
    • search

      QueryBuilder<T> search()
      Returns a query builder object which can be used to search the index.