Query
is a base class for all ad-hoc GDS query types. It is an abstract class allowing each query subtype to provide it's own execute method. Query
implements next method, which returns the next Document returned by the underlying query. It is important to state that the data is not materialized on the Java side until next is called. Query execution merely generates a set of candidate ids, which are then used in next
to return the actual Documents. Total number of Documents, after the query has been executed, but before a first call to next is made, is available by calling size
. Number of remaining Documents *after* at least one call to next
is available by calling itemsLeft
. Number of Documents a query can return can be limited by using limit
Important: For now only index based queries are supported, meaning data has to have been previously indexed in order for queries to work. Should an attempt be made to run a query and no index is present an exception is thrown.
|
|
|
|
|
|
|
|
|
|
|
|