org.modeshape.graph.search
Interface SearchEngine

All Known Implementing Classes:
AbstractSearchEngine

@ThreadSafe
public interface SearchEngine

A component that acts as a search engine for the content within a single RepositorySource. This engine manages a set of indexes and provides search functionality for each of the workspaces within the source, and provides various methods to (re)index the content contained with source's workspaces and keep the indexes up-to-date via changes.


Method Summary
 SearchEngineProcessor createProcessor(ExecutionContext context, Observer observer, boolean readOnly)
          Create the SearchEngineProcessor implementation that can be used to operate against the SearchEngineWorkspace instances.
 String getSourceName()
          Get the name of the source that can be searched with an engine that uses this provider.
 void index(ExecutionContext context, Iterable<ChangeRequest> changes)
          Update the indexes with the supplied set of changes to the content.
 

Method Detail

getSourceName

String getSourceName()
Get the name of the source that can be searched with an engine that uses this provider.

Returns:
the name of the source that is to be searchable; never null

createProcessor

SearchEngineProcessor createProcessor(ExecutionContext context,
                                      Observer observer,
                                      boolean readOnly)
Create the SearchEngineProcessor implementation that can be used to operate against the SearchEngineWorkspace instances.

Note that the resulting processor must be closed by the caller when completed.

Parameters:
context - the context in which the processor is to be used; never null
observer - the observer of any events created by the processor; may be null
readOnly - true if the processor will only be reading or searching, or false if the processor will be used to update the workspaces
Returns:
the processor; may not be null

index

void index(ExecutionContext context,
           Iterable<ChangeRequest> changes)
           throws SearchEngineException
Update the indexes with the supplied set of changes to the content.

Parameters:
context - the execution context for which this session is to be established; may not be null
changes - the set of changes to the content
Throws:
IllegalArgumentException - if the path is null
RepositorySourceException - if there is a problem accessing the content
SearchEngineException - if there is a problem updating the indexes


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.