|
Nuxeo Enterprise Platform 5.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.core.search.api.backend.impl.AbstractSearchEngineBackend
org.nuxeo.ecm.core.search.backend.compass.CompassBackend
public class CompassBackend
Compass search engine backend implementation.
| Field Summary | |
|---|---|
protected Compass |
compass
|
protected ConnectionConf |
connectionConf
|
protected SearchServiceInternals |
searchService
|
protected Map |
sessions
|
| Fields inherited from class org.nuxeo.ecm.core.search.api.backend.impl.AbstractSearchEngineBackend |
|---|
configurationFileName, name, supportedAnalyzers, supportedFieldTypes |
| Constructor Summary | |
|---|---|
CompassBackend()
|
|
CompassBackend(String name)
|
|
CompassBackend(String name,
String configurationFileName)
|
|
| Method Summary | |
|---|---|
protected static Resource |
buildResource(CompassSession session,
ResourceBuilder builder,
ResolvedResource iResource,
List<ResolvedData> commonData,
String joinIdName,
String joinIdValue,
ACP acp)
The main Resource builder, called by index(). |
protected ResultItem |
buildResultItem(Resource r)
Converts a Resource, typically from the Compass Results to a DocumentResultItem. |
protected ResultSet |
buildResultSet(CompassHits compassHits,
int offset,
int range,
SQLQuery nxqlQuery,
SearchPrincipal principal)
|
void |
clear()
Clear all the indexes. |
void |
closeSession(String sid)
Closes a search service session given its session id. |
protected NativeQuery |
convertToNativeQuery(ComposedNXQuery query)
|
protected Compass |
createCompass()
|
SearchServiceSession |
createSession()
Opens a new session. |
void |
deleteAggregatedResources(String key)
Deletes an index given an aggregated resources key |
void |
deleteAtomicResource(String key)
Deletes an atomic resource given its key. |
protected Serializable |
extractAtomicProperty(Property prop,
String sValue,
IndexableResourceDataConf dataConf)
Extracts a property from the result resource. |
static String |
getAlias(ResolvedResource resource)
TODO change this to an extension point. |
protected Compass |
getCompass()
Builds the shared thread-safe compass object using the standard configuration file compass.cfg.xml. |
protected String |
getConnectionString()
|
protected int |
getIndexingDocBatchSize()
|
void |
index(ResolvedResources resources)
Creates Compass resources from Search Service's resources. |
protected void |
index(ResolvedResources resources,
CompassBackendSession session)
|
protected void |
initSearchService()
|
protected boolean |
isBoundToIndexingThread()
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
|
void |
saveAllSessions()
Save all pending sessions. |
ResultSet |
searchQuery(CompassNativeQuery cnQuery,
int offset,
int range)
|
ResultSet |
searchQuery(ComposedNXQuery cQuery,
int offset,
int range)
Searches results given an NXQL query. |
ResultSet |
searchQuery(NativeQuery nativeQuery,
int offset,
int range)
Searches results given a native query. |
ResultSet |
searchQuery(NativeQueryString queryString,
int offset,
int range)
Searches results given a backened specific native query string. |
ResultSet |
searchQuery(SQLQuery query,
SearchPrincipal principal,
int offset,
int range)
|
| Methods inherited from class org.nuxeo.ecm.core.search.api.backend.impl.AbstractSearchEngineBackend |
|---|
getConfigurationFileName, getName, getSupportedAnalyzersFor, getSupportedFieldTypes, setConfigurationFileName, setName |
| Methods inherited from class org.nuxeo.runtime.model.DefaultComponent |
|---|
activate, deactivate, getAdapter, registerExtension, unregisterContribution, unregisterExtension |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Compass compass
protected SearchServiceInternals searchService
protected ConnectionConf connectionConf
protected final Map sessions
| Constructor Detail |
|---|
public CompassBackend()
public CompassBackend(String name)
public CompassBackend(String name,
String configurationFileName)
| Method Detail |
|---|
protected void initSearchService()
protected Compass getCompass()
protected static Resource buildResource(CompassSession session,
ResourceBuilder builder,
ResolvedResource iResource,
List<ResolvedData> commonData,
String joinIdName,
String joinIdValue,
ACP acp)
throws IndexingException
session - builder - iResource - commonData - joinIdName - joinIdValue - acp - ACP of the indexed document
CompassException
IndexingExceptionpublic static String getAlias(ResolvedResource resource)
resource -
protected void index(ResolvedResources resources,
CompassBackendSession session)
throws IndexingException
IndexingException
public void index(ResolvedResources resources)
throws IndexingException
All schema resources get merged as a single Compass Resource and gets the joining id as Compass id.
Each resource of a different kind gives rise to a Compass Resource, its own id being used as Compass id.
It's quite possible that Compass could do a better join of handling joins etc by its own concept of MultiResource.
resources - : ResolvedResources instance.
IndexingException
public void deleteAggregatedResources(String key)
throws IndexingException
SearchEngineBackend
This will remove all resources indexed with key
as key used to identified the set ot resources. See
ResolvedResources.getId()
key - : aggregated resources key.
IndexingException
public void clear()
throws IndexingException
SearchEngineBackend
IndexingException
public ResultSet searchQuery(NativeQueryString queryString,
int offset,
int range)
throws SearchException,
QueryException
SearchEngineBackend
queryString - : a backened specific native query string wrapperoffset - pagination startrange - pagination stop
SearchException
QueryException
public ResultSet searchQuery(ComposedNXQuery cQuery,
int offset,
int range)
throws SearchException,
QueryException
SearchEngineBackend
cQuery - : a native NXP queryoffset - pagination startrange - number of results.
SearchException - if an error occured while performing the search
QueryException - if the query is invalid or unsupported
public ResultSet searchQuery(SQLQuery query,
SearchPrincipal principal,
int offset,
int range)
throws SearchException,
QueryException
SearchException
QueryException
public ResultSet searchQuery(CompassNativeQuery cnQuery,
int offset,
int range)
throws SearchException,
QueryException
SearchException
QueryException
protected Serializable extractAtomicProperty(Property prop,
String sValue,
IndexableResourceDataConf dataConf)
throws SearchException
For multiple properties, this will be actually one of the elements. Same for complex properties.
For non string properties, the implementation tries first to get the value through Compass and else falls back to java deserialization.
SearchException
protected ResultItem buildResultItem(Resource r)
throws SearchException
r - Input Resource
SearchException
protected ResultSet buildResultSet(CompassHits compassHits,
int offset,
int range,
SQLQuery nxqlQuery,
SearchPrincipal principal)
throws SearchException
SearchException
public ResultSet searchQuery(NativeQuery nativeQuery,
int offset,
int range)
throws SearchException,
QueryException
SearchEngineBackend
nativeQuery - : a backened specific native query wrapper.offset - pagination startrange - pagination stop
SearchException - if an error occured while performing the search
QueryException - if the query is invalid or unsupported
public void deleteAtomicResource(String key)
throws IndexingException
SearchEngineBackendThis will remove the resource identified by this resource key only.
key - : atomic resource key
IndexingException
protected NativeQuery convertToNativeQuery(ComposedNXQuery query)
throws SearchException
SearchExceptionprotected String getConnectionString()
public void registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
registerContribution in class AbstractSearchEngineBackendpublic void closeSession(String sid)
SearchEngineBackend
public SearchServiceSession createSession()
SearchEngineBackend
protected Compass createCompass()
protected boolean isBoundToIndexingThread()
protected int getIndexingDocBatchSize()
public void saveAllSessions()
throws IndexingException
SearchEngineBackend
IndexingException
|
Nuxeo Enterprise Platform 5.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||