public interface _SearchOperationsNC extends _StatefulServiceInterfaceOperationsNC
Search
instance keeps up with several queries and
lazily-loads the results as hasNext
, next
and
results
are called. These queries are created by the
by* methods.
Each instance also has a number of settings which can all be
changed from their defaults via accessors, e.g.
setBatchSize
or setCaseSensitive
.
The only methods which are required for the proper functioning of a
Search
instance are:
onlyType
, onlyTypes
OR
allTypes
allTypes
method is discouraged, since it is
possibly very resource intensive, which is why any attempt to
receive results without specifically setting types or allowing all
is prohibited.IQuery
Modifier and Type | Method and Description |
---|---|
void |
activeQueries_async(AMD_Search_activeQueries __cb)
Returns the number of active queries.
|
void |
addOrderByAsc_async(AMD_Search_addOrderByAsc __cb,
java.lang.String path)
A path from the target entity which will be added to the
current stack of order statements applied to the query.
|
void |
addOrderByDesc_async(AMD_Search_addOrderByDesc __cb,
java.lang.String path)
A path from the target entity which will be added to the
current stack of order statements applied to the query.
|
void |
allTypes_async(AMD_Search_allTypes __cb)
Permits all types to be returned.
|
void |
and_async(AMD_Search_and __cb)
Applies the next by* method to the previous by* method, so
that a call
hasNext , next , or
results sees only the intersection of the two
calls. |
void |
byAnnotatedWith_async(AMD_Search_byAnnotatedWith __cb,
java.util.List<Annotation> examples)
Finds entities annotated with an
Annotation similar to the example. |
void |
byFullText_async(AMD_Search_byFullText __cb,
java.lang.String query)
Passes the query as is to the Lucene backend.
|
void |
byGroupForTags_async(AMD_Search_byGroupForTags __cb,
java.lang.String group)
Returns transient (without ID)
TagAnnotation instances which
represent all the
TagAnnotation tags in the given group. |
void |
byHqlQuery_async(AMD_Search_byHqlQuery __cb,
java.lang.String query,
Parameters params)
Delegates to
omero.api.IQuery.findAllByQuery method
to take advantage of the and , or , and
not methods, or queue-semantics. |
void |
byLuceneQueryBuilder_async(AMD_Search_byLuceneQueryBuilder __cb,
java.lang.String fields,
java.lang.String from,
java.lang.String to,
java.lang.String dateType,
java.lang.String query)
Builds a Lucene query and passes it to the Lucene backend.
|
void |
bySimilarTerms_async(AMD_Search_bySimilarTerms __cb,
java.util.List<java.lang.String> terms)
Returns transient (without ID)
TextAnnotation instances which represent
terms which are similar to the given terms. |
void |
bySomeMustNone_async(AMD_Search_bySomeMustNone __cb,
java.util.List<java.lang.String> some,
java.util.List<java.lang.String> must,
java.util.List<java.lang.String> none)
Builds a Lucene query and passes it to
byFullText . |
void |
byTagForGroups_async(AMD_Search_byTagForGroups __cb,
java.lang.String tag)
Creates a query which will return transient (without ID)
TagAnnotation instances which represent
all the TagAnnotation tag groups which
the given tag belongs to. |
void |
clearQueries_async(AMD_Search_clearQueries __cb)
Removes all active queries (leaving
resetDefaults
settings alone), such that activeQueries will
return 0. |
void |
currentMetadata_async(AMD_Search_currentMetadata __cb)
Provides access to the extra query information (for example
Lucene score and boost values) for a single call to
next . |
void |
currentMetadataList_async(AMD_Search_currentMetadataList __cb)
Provides access to the extra query information (for example
Lucene score and boost values) for a single call to
results . |
void |
fetchAlso_async(AMD_Search_fetchAlso __cb,
java.util.List<java.lang.String> fetches)
Adds a fetch clause for loading non-annotation fields of
returned entities.
|
void |
fetchAnnotations_async(AMD_Search_fetchAnnotations __cb,
java.util.List<java.lang.String> classes)
Queries the database for all
Annotation
annotations of the given types for all returned instances. |
void |
getBatchSize_async(AMD_Search_getBatchSize __cb)
Returns the current batch size.
|
void |
hasNext_async(AMD_Search_hasNext __cb)
Returns
true if another call to
next is valid. |
void |
isAllowLeadingWildcard_async(AMD_Search_isAllowLeadingWildcard __cb)
Returns the current leading-wildcard setting.
|
void |
isCaseSensitive_async(AMD_Search_isCaseSensitive __cb)
Returns the current case sensitivity setting.
|
void |
isMergedBatches_async(AMD_Search_isMergedBatches __cb)
Returns the current merged-batches setting.
|
void |
isReturnUnloaded_async(AMD_Search_isReturnUnloaded __cb)
Returns the current return-unloaded setting.
|
void |
isUseProjections_async(AMD_Search_isUseProjections __cb)
Returns the current use-projection setting.
|
void |
next_async(AMD_Search_next __cb)
Returns the next entity from the current query.
|
void |
not_async(AMD_Search_not __cb)
Applies the next by* method to the previous by* method, so
that a call
hasNext , next , or
results sees only the intersection of the two
calls. |
void |
notAnnotatedBy_async(AMD_Search_notAnnotatedBy __cb,
Details d)
Restricts entities by who has not annotated them with an
Annotation matching the other filters. |
void |
notOwnedBy_async(AMD_Search_notOwnedBy __cb,
Details d)
Uses the
Details.getOwner() and
Details.getGroup() information to
restrict the entities which will be returned. |
void |
onlyAnnotatedBetween_async(AMD_Search_onlyAnnotatedBetween __cb,
RTime start,
RTime stop)
Restricts entities by the time in which any annotation
(which matches the other filters) was added them.
|
void |
onlyAnnotatedBy_async(AMD_Search_onlyAnnotatedBy __cb,
Details d)
Restricts entities by who has annotated them with an
Annotation matching the other filters. |
void |
onlyAnnotatedWith_async(AMD_Search_onlyAnnotatedWith __cb,
java.util.List<java.lang.String> classes)
Restricts entities to having an
Annotation of all the given types. |
void |
onlyCreatedBetween_async(AMD_Search_onlyCreatedBetween __cb,
RTime start,
RTime stop)
Restricts the time between which an entity may have been
created.
|
void |
onlyIds_async(AMD_Search_onlyIds __cb,
java.util.List<java.lang.Long> ids)
Restricts the set of ids which will be checked.
|
void |
onlyModifiedBetween_async(AMD_Search_onlyModifiedBetween __cb,
RTime start,
RTime stop)
Restricts the time between which an entity may have last
been modified.
|
void |
onlyOwnedBy_async(AMD_Search_onlyOwnedBy __cb,
Details d)
Uses the
Details.getOwner() and
Details.getGroup() information to
restrict the entities which will be returned. |
void |
onlyType_async(AMD_Search_onlyType __cb,
java.lang.String klass)
Restricts the search to a single type.
|
void |
onlyTypes_async(AMD_Search_onlyTypes __cb,
java.util.List<java.lang.String> classes)
Restricts searches to a set of types.
|
void |
or_async(AMD_Search_or __cb)
Applies the next by* method to the previous by* method, so
that a call
hasNext , next or
results sees only the union of the two calls. |
void |
remove_async(AMD_Search_remove __cb)
Unsupported operation.
|
void |
resetDefaults_async(AMD_Search_resetDefaults __cb)
Resets all settings (non-query state) to the original
default values, as if the instance had just be created.
|
void |
results_async(AMD_Search_results __cb)
Returns up to
getBatchSize batch size number of
results along with the related query metadata. |
void |
setAllowLeadingWildcard_async(AMD_Search_setAllowLeadingWildcard __cb,
boolean allowLeadingWildcard)
Permits full-text queries with a leading query if true.
|
void |
setBatchSize_async(AMD_Search_setBatchSize __cb,
int size)
Sets the maximum number of results that will be returned by
one call to
results . |
void |
setCaseSensitive_async(AMD_Search_setCaseSensitive __cb,
boolean caseSensitive)
Sets the case sensitivity on all queries where
case-sensitivity is supported.
|
void |
setCaseSentivice_async(AMD_Search_setCaseSentivice __cb,
boolean caseSensitive)
Deprecated.
use setCaseSensitive instead
|
void |
setMergedBatches_async(AMD_Search_setMergedBatches __cb,
boolean merge)
Set whether or not results from two separate queries can be
returned in the same call to
results . |
void |
setReturnUnloaded_async(AMD_Search_setReturnUnloaded __cb,
boolean returnUnloaded)
Determines if all results should be returned as unloaded
objects.
|
void |
setUseProjections_async(AMD_Search_setUseProjections __cb,
boolean useProjections)
Determines if Lucene queries should not hit the database.
|
void |
unordered_async(AMD_Search_unordered __cb)
Removes the current stack of order statements.
|
activate_async, close_async, getCurrentEventContext_async, passivate_async
void activeQueries_async(AMD_Search_activeQueries __cb) throws ServerError
activeQueries
gives the minimum number of
remaining calls to results
when batches are not
merged.__cb
- The callback object for the operation.ServerError
void setBatchSize_async(AMD_Search_setBatchSize __cb, int size) throws ServerError
results
. If batches are not merged,
then results may often be less than the batch size. If
batches are merged, then only the last call to
results
can be less than batch size.
Note: some query types may not support batching at the
query level, and all instances must then be loaded into
memory simultaneously.__cb
- The callback object for the operation.size
- maximum number of results per call to
results
ServerError
void getBatchSize_async(AMD_Search_getBatchSize __cb) throws ServerError
setBatchSize
has not been called, the default value will be in effect.__cb
- The callback object for the operation.ServerError
void setMergedBatches_async(AMD_Search_setMergedBatches __cb, boolean merge) throws ServerError
results
.__cb
- The callback object for the operation.ServerError
void isMergedBatches_async(AMD_Search_isMergedBatches __cb) throws ServerError
setMergedBatches
has not been called, the
default value will be in effect.__cb
- The callback object for the operation.ServerError
void setCaseSentivice_async(AMD_Search_setCaseSentivice __cb, boolean caseSensitive) throws ServerError
__cb
- The callback object for the operation.ServerError
void setCaseSensitive_async(AMD_Search_setCaseSensitive __cb, boolean caseSensitive) throws ServerError
__cb
- The callback object for the operation.ServerError
void isCaseSensitive_async(AMD_Search_isCaseSensitive __cb) throws ServerError
setCaseSensitive
has not been called, the
default value will be in effect.__cb
- The callback object for the operation.ServerError
void setUseProjections_async(AMD_Search_setUseProjections __cb, boolean useProjections) throws ServerError
__cb
- The callback object for the operation.ServerError
void isUseProjections_async(AMD_Search_isUseProjections __cb) throws ServerError
setUseProjections
for more. If
setUseProjections
has not been called, the
default value will be in effect.__cb
- The callback object for the operation.ServerError
void setReturnUnloaded_async(AMD_Search_setReturnUnloaded __cb, boolean returnUnloaded) throws ServerError
IQuery
. This value
overrides the setUseProjections
setting.__cb
- The callback object for the operation.ServerError
void isReturnUnloaded_async(AMD_Search_isReturnUnloaded __cb) throws ServerError
setReturnUnloaded
has not been called, the
default value will be in effect.__cb
- The callback object for the operation.ServerError
void setAllowLeadingWildcard_async(AMD_Search_setAllowLeadingWildcard __cb, boolean allowLeadingWildcard) throws ServerError
__cb
- The callback object for the operation.ServerError
void isAllowLeadingWildcard_async(AMD_Search_isAllowLeadingWildcard __cb) throws ServerError
byFullText
and bySomeMustNone
will throw
an ApiUsageException
, since leading-wildcard
searches are quite slow. Use
setAllowLeadingWildcard
in order to permit this
usage.__cb
- The callback object for the operation.ServerError
void onlyType_async(AMD_Search_onlyType __cb, java.lang.String klass) throws ServerError
__cb
- The callback object for the operation.ServerError
void onlyTypes_async(AMD_Search_onlyTypes __cb, java.util.List<java.lang.String> classes) throws ServerError
__cb
- The callback object for the operation.ServerError
void allTypes_async(AMD_Search_allTypes __cb) throws ServerError
__cb
- The callback object for the operation.ServerError
void onlyIds_async(AMD_Search_onlyIds __cb, java.util.List<java.lang.Long> ids) throws ServerError
__cb
- The callback object for the operation.ids
- Can be null, in which case the previous
restriction is removed.ServerError
void onlyOwnedBy_async(AMD_Search_onlyOwnedBy __cb, Details d) throws ServerError
Details.getOwner()
and
Details.getGroup()
information to
restrict the entities which will be returned. If both are
non-null, the two restrictions are joined by an AND.__cb
- The callback object for the operation.d
- Can be null, in which case the previous
restriction is removed.ServerError
void notOwnedBy_async(AMD_Search_notOwnedBy __cb, Details d) throws ServerError
Details.getOwner()
and
Details.getGroup()
information to
restrict the entities which will be returned. If both are
non-null, the two restrictions are joined by an AND.__cb
- The callback object for the operation.d
- Can be null, in which case the previous
restriction is removed.ServerError
void onlyCreatedBetween_async(AMD_Search_onlyCreatedBetween __cb, RTime start, RTime stop) throws ServerError
__cb
- The callback object for the operation.start
- Can be null, i.e. interval open to negative
infinity.stop
- Can be null, i.e. interval opens to positive
infinity.ServerError
void onlyModifiedBetween_async(AMD_Search_onlyModifiedBetween __cb, RTime start, RTime stop) throws ServerError
__cb
- The callback object for the operation.start
- Can be null, i.e. interval open to negative
infinity.stop
- Can be null, i.e. interval open to positive
infinity.ServerError
void onlyAnnotatedBetween_async(AMD_Search_onlyAnnotatedBetween __cb, RTime start, RTime stop) throws ServerError
Details.getCreationEvent()
creation event of the Annotation
.__cb
- The callback object for the operation.start
- Can be null, i.e. interval open to negative
infinity.stop
- Can be null, i.e. interval open to positive
infinity.ServerError
void onlyAnnotatedBy_async(AMD_Search_onlyAnnotatedBy __cb, Details d) throws ServerError
Annotation
matching the other filters.
As onlyOwnedBy
, the
Details.getOwner()
and
Details.getGroup()
information is
combined with an AND condition.__cb
- The callback object for the operation.d
- Can be null, in which case any previous
restriction is removed.ServerError
void notAnnotatedBy_async(AMD_Search_notAnnotatedBy __cb, Details d) throws ServerError
Annotation
matching the other filters.
As notOwnedBy
, the
Details.getOwner()
and
Details.getGroup()
information is
combined with an AND condition.__cb
- The callback object for the operation.d
- Can be null, in which case any previous
restriction is removed.ServerError
void onlyAnnotatedWith_async(AMD_Search_onlyAnnotatedWith __cb, java.util.List<java.lang.String> classes) throws ServerError
Annotation
of all the given types. This
is useful in combination with the other onlyAnnotated*
methods to say, e.g., only annotated with a file by user X.
By default, this value is null
and imposes no
restriction. Passing an empty array implies an object that
is not annotated at all.
Note: If the semantics were OR, then a client would have to
query each class individually, and compare all the various
values, checking which ids are where. However, since this
method defaults to AND, multiple calls (optionally with
isMergedBatches
and isReturnUnloaded
)
and combine the results. Duplicate ids are still possible
so a set of some form should be used to collect the results.__cb
- The callback object for the operation.classes
- Can be empty, in which case restriction is
removed.ServerError
void addOrderByAsc_async(AMD_Search_addOrderByAsc __cb, java.lang.String path) throws ServerError
__cb
- The callback object for the operation.path
- Non-null.ServerError
void addOrderByDesc_async(AMD_Search_addOrderByDesc __cb, java.lang.String path) throws ServerError
__cb
- The callback object for the operation.path
- Non-null.ServerError
void unordered_async(AMD_Search_unordered __cb) throws ServerError
__cb
- The callback object for the operation.ServerError
void fetchAnnotations_async(AMD_Search_fetchAnnotations __cb, java.util.List<java.lang.String> classes) throws ServerError
Annotation
annotations of the given types for all returned instances.__cb
- The callback object for the operation.classes
- Can be empty, which removes previous fetch
setting.ServerError
void fetchAlso_async(AMD_Search_fetchAlso __cb, java.util.List<java.lang.String> fetches) throws ServerError
__cb
- The callback object for the operation.fetches
- Can be empty, which removes previous fetch
setting.ServerError
void resetDefaults_async(AMD_Search_resetDefaults __cb) throws ServerError
__cb
- The callback object for the operation.ServerError
void byGroupForTags_async(AMD_Search_byGroupForTags __cb, java.lang.String group) throws ServerError
TagAnnotation
instances which
represent all the
TagAnnotation
tags in the given group.
The entities are transient and without ownership since
multiple users can own the same tag. This method will
override settings for types.__cb
- The callback object for the operation.group
- Can be null or empty to return all tags.ServerError
void byTagForGroups_async(AMD_Search_byTagForGroups __cb, java.lang.String tag) throws ServerError
TagAnnotation
instances which represent
all the TagAnnotation
tag groups which
the given tag belongs to. The entities are transient and
without ownership since multiple users can own the same tag
group. This method will override settings for types.__cb
- The callback object for the operation.tag
- Can be null or empty to return all groups.ServerError
void byFullText_async(AMD_Search_byFullText __cb, java.lang.String query) throws ServerError
__cb
- The callback object for the operation.query
- May not be null or of zero length.ServerError
void byLuceneQueryBuilder_async(AMD_Search_byLuceneQueryBuilder __cb, java.lang.String fields, java.lang.String from, java.lang.String to, java.lang.String dateType, java.lang.String query) throws ServerError
__cb
- The callback object for the operation.fields
- The fields (comma separated) to search in
(name, description, ...)from
- The date range from, in the form YYYYMMDD
(may be null)to
- The date range to (inclusive), in the form
YYYYMMDD (may be null)dateType
- DATE_TYPE_ACQUISITION
or
DATE_TYPE_IMPORT
query
- May not be null or of zero length.ServerError
void bySimilarTerms_async(AMD_Search_bySimilarTerms __cb, java.util.List<java.lang.String> terms) throws ServerError
TextAnnotation
instances which represent
terms which are similar to the given terms. For example, if
the argument is cell, one return value might have as
its textValue: cellular while another has
cellularize.
No filtering or fetching is performed.__cb
- The callback object for the operation.terms
- Cannot be empty.ServerError
void byHqlQuery_async(AMD_Search_byHqlQuery __cb, java.lang.String query, Parameters params) throws ServerError
omero.api.IQuery.findAllByQuery
method
to take advantage of the and
, or
, and
not
methods, or queue-semantics.__cb
- The callback object for the operation.query
- Not null.ServerError
void bySomeMustNone_async(AMD_Search_bySomeMustNone __cb, java.util.List<java.lang.String> some, java.util.List<java.lang.String> must, java.util.List<java.lang.String> none) throws ServerError
byFullText
.__cb
- The callback object for the operation.some
- Some (at least one) of these terms must be
present in the document. May be null.must
- All of these terms must be present in the
document. May be null.none
- None of these terms may be present in the
document. May be null.ServerError
void byAnnotatedWith_async(AMD_Search_byAnnotatedWith __cb, java.util.List<Annotation> examples) throws ServerError
Annotation
similar to the example. This
does not use Hibernate's
omero.api.IQuery.findByExample
Query-By-Example}
mechanism, since that cannot handle joins. The fields which
are used are:
IObject.getId()
, etc.null
it is assumed to
be a wildcard searched, and only the type of the annotation
is searched. Currently, ListAnnotations are not supported.__cb
- The callback object for the operation.examples
- Not empty.ServerError
void clearQueries_async(AMD_Search_clearQueries __cb) throws ServerError
resetDefaults
settings alone), such that activeQueries
will
return 0.__cb
- The callback object for the operation.ServerError
void and_async(AMD_Search_and __cb) throws ServerError
hasNext
, next
, or
results
sees only the intersection of the two
calls.
For example,
service.onlyType(Image.class);
service.byFullText("foo");
service.intersection();
service.byAnnotatedWith(TagAnnotation.class);
will return only the Images with TagAnnotations.
Calling this method overrides a previous setting of
or
or not
. If there is no active queries
(i.e. activeQueries > 0
), then an
ApiUsageException
will be thrown.
__cb
- The callback object for the operation.ServerError
void or_async(AMD_Search_or __cb) throws ServerError
hasNext
, next
or
results
sees only the union of the two calls.
For example,
service.onlyType(Image.class);
service.byFullText("foo");
service.or();
service.onlyType(Dataset.class);
service.byFullText("foo");
will return both Images and Datasets together.
Calling this method overrides a previous setting of
and
or not
. If there is no active queries
(i.e. activeQueries > 0
), then an
ApiUsageException
will be thrown.__cb
- The callback object for the operation.ServerError
void not_async(AMD_Search_not __cb) throws ServerError
hasNext
, next
, or
results
sees only the intersection of the two
calls.
For example,
service.onlyType(Image.class);
service.byFullText("foo");
service.complement();
service.byAnnotatedWith(TagAnnotation.class);
will return all the Images not annotated with
TagAnnotation.
Calling this method overrides a previous setting of
or
or and
. If there is no active queries
(i.e. activeQueries > 0
), then an
ApiUsageException
will be thrown.
__cb
- The callback object for the operation.ServerError
void hasNext_async(AMD_Search_hasNext __cb) throws ServerError
true
if another call to
next
is valid. A call to next
may throw
an exception for another reason, however.__cb
- The callback object for the operation.ServerError
void next_async(AMD_Search_next __cb) throws ServerError
activeQueries
decremented.
Since this method only returns the entity itself, a single
call to currentMetadata
may follow this call to
gather the extra metadata which is returned in the map via
results
.__cb
- The callback object for the operation.ApiUsageException
- if {code hasNext} returns false.ServerError
void results_async(AMD_Search_results __cb) throws ServerError
getBatchSize
batch size number of
results along with the related query metadata. If
isMergedBatches
batches are merged then the
results from multiple queries may be returned together.__cb
- The callback object for the operation.ApiUsageException
- if hasNext
returns false.ServerError
void currentMetadata_async(AMD_Search_currentMetadata __cb) throws ServerError
next
. This method may only be called once for any
given call to next
.__cb
- The callback object for the operation.ServerError
void currentMetadataList_async(AMD_Search_currentMetadataList __cb) throws ServerError
results
. This method may only be called once for
any given call to results
.__cb
- The callback object for the operation.ServerError
void remove_async(AMD_Search_remove __cb) throws ServerError
__cb
- The callback object for the operation.ServerError