|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SearchService
Search service public interface.
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. does nothing |
void |
saveAllSessions()
Saves all the pending sessions. |
ResultSet |
searchQuery(ComposedNXQuery nxqlQuery,
int offset,
int range)
Deprecated. use CoreSession#query instead |
ResultSet |
searchQuery(NativeQuery nativeQuery,
int offset,
int range)
Deprecated. use CoreSession#query instead |
ResultSet |
searchQuery(NativeQueryString queryString,
java.lang.String backendName,
int offset,
int range)
Deprecated. use CoreSession#query instead |
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)
|
Method Detail |
---|
SearchServiceSession openSession()
Warning: for now on the client is responsible for closing the session.
void closeSession(java.lang.String sid)
sid
- the search service identifiervoid saveAllSessions() throws IndexingException
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.
IndexingException
boolean isEnabled()
It is possible to disable the search service using extension point parameter.
void setStatus(boolean active)
active
- if active is true, then the service will be activatedvoid index(IndexableResources sources, boolean fulltext) throws IndexingException
IndexableResources
instance.
The actual resolution in this case will be done search service side.
sources
- an IndexableResources instancefulltext
- do compute fulltext at resolution time
IndexingException
- wrap low level backend exceptionvoid index(ResolvedResources sources) throws IndexingException
ResolvedResources
This method is useful for performing the resource resolution outside the search service.
sources
- resolved resources
IndexingException
- wrap low level backend exceptionvoid unindex(DocumentModel dm) throws IndexingException
IndexingException
void clear() throws IndexingException
IndexingException
void deleteAggregatedResources(java.lang.String key) throws IndexingException
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
void deleteAtomicResource(java.lang.String key) throws IndexingException
This will remove the resource identified by this resource key only.
key
- atomic resource key
IndexingException
@Deprecated ResultSet searchQuery(ComposedNXQuery nxqlQuery, int offset, int range) throws SearchException, QueryException
CoreSession#query
instead
nxqlQuery
- a NXQL query instanceoffset
- pagination startrange
- number of results
SearchException
- wrap low level backend exception
QueryException
- if the query is invalid or unsupported@Deprecated ResultSet searchQuery(NativeQuery nativeQuery, int offset, int range) throws SearchException, QueryException
CoreSession#query
instead
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 unsupported@Deprecated ResultSet searchQuery(NativeQueryString queryString, java.lang.String backendName, int offset, int range) throws SearchException, QueryException
CoreSession#query
instead
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 backendjava.util.List<java.lang.String> getSupportedAnalyzersFor(java.lang.String backendName)
backendName
- the backend name.
java.util.List<java.lang.String> getSupportedFieldTypes(java.lang.String backendName)
backendName
- the backend name.
IndexableDocType getIndexableDocTypeFor(java.lang.String docType)
docType
- doc type indentifier.
IndexableResourceConf getIndexableResourceConfByName(java.lang.String name, boolean full)
name
- the name of the indexable resource configuration.full
- compute automatic configuration to get the full resource
configuration
IndexableResourceConf getIndexableResourceConfByPrefix(java.lang.String prefix, boolean full)
prefix
- the prefix of the indexable resource configuration.full
- compute automatic configuration to get the full resource
configuration
java.util.Map<java.lang.String,IndexableResourceConf> getIndexableResourceConfs()
java.lang.String[] getAvailableBackendNames()
SearchPrincipal getSearchPrincipal(java.security.Principal principal)
NuxeoPrincipal instance is expected for groups support.
principal
- a java principal instance
FulltextFieldDescriptor getFullTextDescriptorByName(java.lang.String prefixedName)
prefixedName
- the prefixed name with what it's been registered
using extension point.
IndexingEventConf getIndexingEventConfByName(java.lang.String name)
name
- the name under which it's been registered using extension
point.
void invalidateComputedIndexableResourceConfs()
Will be useful if Nuxeo Runtime supports hot deployment in the future.
BlobExtractor getBlobExtractorByName(java.lang.String name)
name
- the name against which the full text extractor has been
registered using extension point.
ResourceTypeDescriptor getResourceTypeDescriptorByName(java.lang.String name)
name
- the resource type name which has been used with extension
point.
int getNumberOfIndexingThreads()
long getIndexingWaitingQueueSize()
void setNumberOfIndexingThreads(int numberOfIndexingThreads)
numberOfIndexingThreads
- : the number of threads maxint getIndexingDocBatchSize()
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.
void setIndexingDocBatchSize(int docBatchSize)
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.
docBatchSize
- number of of document per indexing session before
save()@Deprecated void reindexAll(java.lang.String repoName, java.lang.String path, boolean fulltext) throws IndexingException
If path is null then the reindexing will be done from the root of the repository (i.e : "/").
repoName
- the Nuxeo Core repository name.fulltext
- whether or not we want to index fulltext.
IndexingException
boolean isReindexingAll()
void setReindexingAll(boolean flag)
flag
- bool flagint getActiveIndexingTasks()
long getTotalCompletedIndexingTasks()
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.
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |