|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.platform.search.ejb.SearchServiceBean
public class SearchServiceBean
Search service session bean.
This session bean expects the Nuxeo Runtime core search service available locally (i.e : same JVM).
Constructor Summary | |
---|---|
SearchServiceBean()
|
Method Summary | |
---|---|
void |
clear()
Completely erases the indexes. |
void |
closeSession(java.lang.String sid)
Closes a search service session given its identifier. |
void |
deleteAggregatedResources(java.lang.String key)
Deletes an index given an aggregated resources key. |
void |
deleteAtomicResource(java.lang.String key)
Deletes an atomic resource given its key. |
int |
getActiveIndexingTasks()
Returns the number of running indexing tasks. |
java.lang.String[] |
getAvailableBackendNames()
Returns the list of all backend names. |
BlobExtractor |
getBlobExtractorByName(java.lang.String name)
Returns a blob extractor given its name. |
FulltextFieldDescriptor |
getFullTextDescriptorByName(java.lang.String prefixedName)
Returns the full text descriptor given its name. |
IndexableDocType |
getIndexableDocTypeFor(java.lang.String docType)
Return the indexing information for a given nuxeo core doc type. |
IndexableResourceConf |
getIndexableResourceConfByName(java.lang.String name,
boolean full)
Returns an indexable resource configuration given its name. |
IndexableResourceConf |
getIndexableResourceConfByPrefix(java.lang.String prefix,
boolean full)
Returns an indexable resource configuration given its prefix. |
java.util.Map<java.lang.String,IndexableResourceConf> |
getIndexableResourceConfs()
Returns all the indexable resource configurations registred. |
int |
getIndexingDocBatchSize()
Returns the document batch size. |
IndexingEventConf |
getIndexingEventConfByName(java.lang.String name)
Returns an indexing event configuration given its name. |
long |
getIndexingWaitingQueueSize()
Returns the number of indexing tasks waiting for a slot in the ThreadPool executor. |
int |
getNumberOfIndexingThreads()
Returns the amount of threads the search service will be able to instanciate within its thread pool. |
ResourceTypeDescriptor |
getResourceTypeDescriptorByName(java.lang.String name)
Returns a resource type descriptor instance. |
SearchPrincipal |
getSearchPrincipal(java.security.Principal principal)
Computes a search principal out from a principal instance. |
java.util.List<java.lang.String> |
getSupportedAnalyzersFor(java.lang.String backendName)
Returns the supported analyers for a given backend. |
java.util.List<java.lang.String> |
getSupportedFieldTypes(java.lang.String backendName)
Returns the supported fieldd types for a given backend. |
long |
getTotalCompletedIndexingTasks()
Returns the total number of completed indexing tasks. |
void |
index(IndexableResources sources,
boolean fulltext)
Adds / updates index(es) given an IndexableResources
instance. |
void |
index(ResolvedResources sources)
Adds / updates index(es) given ( ResolvedResources
This method is useful for performing the resource resolution outside the
search service. |
void |
invalidateComputedIndexableResourceConfs()
Invalidates the computed indexable resource confs. |
boolean |
isEnabled()
Is the search service enabled? |
boolean |
isReindexingAll()
Is the search service reindexing the while indexes? |
SearchServiceSession |
openSession()
Opens a new session against the search service. |
void |
reindexAll(java.lang.String repoName,
java.lang.String path,
boolean fulltext)
Deprecated. |
void |
saveAllSessions()
Saves all the pending sessions. |
ResultSet |
searchQuery(ComposedNXQuery nxqlQuery,
int offset,
int range)
Searches results given an NXQL query. |
ResultSet |
searchQuery(NativeQuery nativeQuery,
int offset,
int range)
Searches results given a backend native query wrapper. |
ResultSet |
searchQuery(NativeQueryString queryString,
java.lang.String backendName,
int offset,
int range)
Searches results given a backend native query string. |
void |
setIndexingDocBatchSize(int docBatchSize)
Sets the document batch size. |
void |
setNumberOfIndexingThreads(int numberOfIndexingThreads)
Sets the amount of threads the search service will be able to instanciate within its thread pool. |
void |
setReindexingAll(boolean flag)
Reindex all setter. |
void |
setStatus(boolean active)
Sets the status of the search service. |
void |
unindex(DocumentModel dm)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SearchServiceBean()
Method Detail |
---|
public void deleteAggregatedResources(java.lang.String key) throws IndexingException
SearchService
This will remove all resources indexed with
key as key used to identified the set ot resources. See
ResolvedResources.getId()
deleteAggregatedResources
in interface SearchService
key
- aggregated resources key.
IndexingException
public void deleteAtomicResource(java.lang.String key) throws IndexingException
SearchService
This will remove the resource identified by this resource key only.
deleteAtomicResource
in interface SearchService
key
- atomic resource key
IndexingException
public void index(IndexableResources sources, boolean fulltext) throws IndexingException
SearchService
IndexableResources
instance.
The actual resolution in this case will be done search service side.
index
in interface SearchService
sources
- an IndexableResources instancefulltext
- do compute fulltext at resolution time
IndexingException
- wrap low level backend exceptionpublic void unindex(DocumentModel dm) throws IndexingException
unindex
in interface SearchService
IndexingException
public ResultSet searchQuery(NativeQuery nativeQuery, int offset, int range) throws SearchException, QueryException
SearchService
searchQuery
in interface SearchService
nativeQuery
- the backend native query wrapper.offset
- pagination startrange
- number of results
SearchException
- wrap low level backend exception
QueryException
- if the query is invalid or unsupportedpublic ResultSet searchQuery(ComposedNXQuery nxqlQuery, int offset, int range) throws SearchException, QueryException
SearchService
searchQuery
in interface SearchService
nxqlQuery
- a NXQL query instanceoffset
- pagination startrange
- number of results
SearchException
- wrap low level backend exception
QueryException
- if the query is invalid or unsupportedpublic ResultSet searchQuery(NativeQueryString queryString, java.lang.String backendName, int offset, int range) throws SearchException, QueryException
SearchService
searchQuery
in interface SearchService
queryString
- the backend native query string wrapper.backendName
- the backened name to apply the query on. If backened
name is null then use the default indexing backendsoffset
- pagination startrange
- number of results
SearchException
- wrap low level backend exception
QueryException
- wrong query, rewrapped from backendpublic java.util.List<java.lang.String> getSupportedAnalyzersFor(java.lang.String backendName)
SearchService
getSupportedAnalyzersFor
in interface SearchService
backendName
- the backend name.
public java.util.List<java.lang.String> getSupportedFieldTypes(java.lang.String backendName)
SearchService
getSupportedFieldTypes
in interface SearchService
backendName
- the backend name.
public IndexableResourceConf getIndexableResourceConfByName(java.lang.String name, boolean full)
SearchService
getIndexableResourceConfByName
in interface SearchService
name
- the name of the indexable resource configuration.full
- compute automatic configuration to get the full resource
configuration
public IndexableDocType getIndexableDocTypeFor(java.lang.String docType)
SearchService
getIndexableDocTypeFor
in interface SearchService
docType
- doc type indentifier.
public java.util.Map<java.lang.String,IndexableResourceConf> getIndexableResourceConfs()
SearchService
getIndexableResourceConfs
in interface SearchService
public java.lang.String[] getAvailableBackendNames()
SearchService
getAvailableBackendNames
in interface SearchService
public SearchPrincipal getSearchPrincipal(java.security.Principal principal)
SearchService
NuxeoPrincipal instance is expected for groups support.
getSearchPrincipal
in interface SearchService
principal
- a java principal instance
public IndexableResourceConf getIndexableResourceConfByPrefix(java.lang.String prefix, boolean full)
SearchService
getIndexableResourceConfByPrefix
in interface SearchService
prefix
- the prefix of the indexable resource configuration.full
- compute automatic configuration to get the full resource
configuration
public boolean isEnabled()
SearchService
It is possible to disable the search service using extension point parameter.
isEnabled
in interface SearchService
public void setStatus(boolean active)
SearchService
setStatus
in interface SearchService
active
- if active is true, then the service will be activatedpublic FulltextFieldDescriptor getFullTextDescriptorByName(java.lang.String prefixedName)
SearchService
getFullTextDescriptorByName
in interface SearchService
prefixedName
- the prefixed name with what it's been registered
using extension point.
public IndexingEventConf getIndexingEventConfByName(java.lang.String name)
SearchService
getIndexingEventConfByName
in interface SearchService
name
- the name under which it's been registered using extension
point.
public void invalidateComputedIndexableResourceConfs()
SearchService
Will be useful if Nuxeo Runtime supports hot deployment in the future.
invalidateComputedIndexableResourceConfs
in interface SearchService
public void clear() throws IndexingException
SearchService
clear
in interface SearchService
IndexingException
public BlobExtractor getBlobExtractorByName(java.lang.String name)
SearchService
getBlobExtractorByName
in interface SearchService
name
- the name against which the full text extractor has been
registered using extension point.
public ResourceTypeDescriptor getResourceTypeDescriptorByName(java.lang.String name)
SearchService
getResourceTypeDescriptorByName
in interface SearchService
name
- the resource type name which has been used with extension
point.
public void index(ResolvedResources sources) throws IndexingException
SearchService
ResolvedResources
This method is useful for performing the resource resolution outside the search service.
index
in interface SearchService
sources
- resolved resources
IndexingException
- wrap low level backend exceptionpublic long getIndexingWaitingQueueSize()
SearchService
getIndexingWaitingQueueSize
in interface SearchService
public int getNumberOfIndexingThreads()
SearchService
getNumberOfIndexingThreads
in interface SearchService
public void closeSession(java.lang.String sid)
SearchService
closeSession
in interface SearchService
sid
- the search service identifierpublic SearchServiceSession openSession()
SearchService
Warning: for now on the client is responsible for closing the session.
openSession
in interface SearchService
public int getIndexingDocBatchSize()
SearchService
In case of batch indexing we can choose to save the indexing session for a given amount of document. Default is one meaning the session is saved after every insertion. You might want to increase this while performing bulk document imports.
getIndexingDocBatchSize
in interface SearchService
public void setIndexingDocBatchSize(int docBatchSize)
SearchService
In case of batch indexing we can choose to save the indexing session for a given amount of document. Default is one meaning the session is saved after every insertion. You might want to increase this while performing bulk document imports.
setIndexingDocBatchSize
in interface SearchService
docBatchSize
- number of of document per indexing session before
save()public void setNumberOfIndexingThreads(int numberOfIndexingThreads)
SearchService
setNumberOfIndexingThreads
in interface SearchService
numberOfIndexingThreads
- : the number of threads maxpublic void saveAllSessions() throws IndexingException
SearchService
This is useful when using document batch size greater than 1 since if the amount of documents indexed are not an exact multiple of the document batch size then one might want to flush right now on demande the remaning resources in sessions before the next window size is reached.
saveAllSessions
in interface SearchService
IndexingException
@Deprecated public void reindexAll(java.lang.String repoName, java.lang.String path, boolean fulltext) throws IndexingException
SearchService
If path is null then the reindexing will be done from the root of the repository (i.e : "/").
reindexAll
in interface SearchService
repoName
- the Nuxeo Core repository name.fulltext
- whether or not we want to index fulltext.
IndexingException
public int getActiveIndexingTasks()
SearchService
getActiveIndexingTasks
in interface SearchService
public long getTotalCompletedIndexingTasks()
SearchService
If you want to use this API for monitoring purpose, you should be aware that the total number of indexing tasks is reinitialized when the component is loaded only. Thus you should keep track of this value before performing your indexing operation you want to keep track of.
getTotalCompletedIndexingTasks
in interface SearchService
public boolean isReindexingAll()
SearchService
isReindexingAll
in interface SearchService
public void setReindexingAll(boolean flag)
SearchService
setReindexingAll
in interface SearchService
flag
- bool flag
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |