Package sonia.scm.search
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 SummaryModifier and TypeMethodDescriptionforResource(String resource) Apply a lock for a specific resource.default SearchEngine.ForType<T>forResource(ModelObject resource) This method is a shortcut forforResource(String)with the id of the given resource.search()Returns a query builder object which can be used to search the index.voidSubmits a task to update the index.voidupdate(SerializableIndexTask<T> task) Submits a task to update the index.Name of the index which should be used.
- 
Method Details- 
withIndexName of the index which should be used. If not specified the default index will be used.- Parameters:
- name- name of index
- Returns:
- this
 
- 
forResourceApply 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
 
- 
forResourceThis method is a shortcut forforResource(String)with the id of the given resource.- Parameters:
- resource- resource in form of model object
- Returns:
- this
 
- 
updateSubmits 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 theCentralWorkQueue, for more information about the task serialization have a look at theCentralWorkQueuedocumentation.- Parameters:
- task- serializable task for updating the index
 
- 
updateSubmits 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
 
- 
searchQueryBuilder<T> search()Returns a query builder object which can be used to search the index.
 
-