public abstract class AbstractDocumentQuery<T,TSelf extends AbstractDocumentQuery<T,TSelf>> extends Object implements IRavenQueryInspector, IAbstractDocumentQuery<T>
Modifier and Type | Field and Description |
---|---|
protected Action1<QueryResult> |
afterQueryExecutedCallback |
protected Function1<Reference<RavenJObject>,Boolean> |
afterStreamExecutedCallback |
protected boolean |
allowMultipleIndexEntriesForSameDocumentToResultTransformer |
protected Action1<IndexQuery> |
beforeQueryExecutionAction |
protected Class<T> |
clazz |
protected Date |
cutoff
The cutoff date to use for detecting staleness in the index
|
protected Etag |
cutoffEtag |
protected String |
defaultField |
protected QueryOperator |
defaultOperator |
protected boolean |
disableCaching
Determine if query results should be cached.
|
protected boolean |
disableEntitiesTracking
Determines if entities should be tracked and kept in memory
|
protected double |
distanceErrorPct |
protected boolean |
distinct |
protected String[] |
fieldsToFetch
The list of fields to project directly from the index on the server
|
protected String[] |
groupByFields
Fields to group on
|
protected List<HighlightedField> |
highlightedFields
The fields to highlight
|
protected String |
highlighterKeyName
Highlighter key
|
protected String[] |
highlighterPostTags
Highlighter post tags
|
protected String[] |
highlighterPreTags
Highlighter pre tags
|
protected RavenQueryHighlightings |
highlightings
Holds the query highlightings
|
protected Set<String> |
includes
The paths to include when loading the query
|
protected String |
indexName
The index to query
|
protected boolean |
isMapReduce |
protected boolean |
isSpatialQuery |
protected Tuple<String,String> |
lastEquality |
protected boolean |
negate
Whatever to negate the next operation
|
protected String[] |
orderByFields
The fields to order the results by
|
protected Integer |
pageSize
The page size to use when querying the index
|
protected String[] |
projectionFields
The list of fields to project directly from the results
|
protected IDocumentQueryListener[] |
queryListeners
The query listeners for this query
|
protected QueryOperation |
queryOperation |
protected String |
queryShape |
protected RavenQueryStatistics |
queryStats
Holds the query stats
|
protected StringBuilder |
queryText
The query to use
|
protected String |
resultsTransformer
The name of the results transformer to use after executing this query
|
protected Set<Class<?>> |
rootTypes |
protected boolean |
shouldExplainScores
Determine if scores of query results should be explained
|
protected boolean |
showQueryTimings
Indicates if detailed timings should be calculated for various query parts
(Lucene search, loading documents, transforming results).
|
protected Set<Tuple<String,SortOptions>> |
sortByHints
The types to sort the fields by (NULL if not specified)
|
protected String |
spatialFieldName |
protected SpatialOptions.SpatialRelation |
spatialRelation |
protected SpatialOptions.SpatialUnits |
spatialUnits |
protected int |
start
which record to start reading from
|
protected IDatabaseCommands |
theDatabaseCommands
The database commands to use
|
protected InMemoryDocumentSessionOperations |
theSession
The session for this query
|
protected boolean |
theWaitForNonStaleResults
Should we wait for non stale results
|
protected boolean |
theWaitForNonStaleResultsAsOfNow
Should we wait for non stale results as of now?
|
protected long |
timeout
Timeout for this query
|
protected Map<String,RavenJToken> |
transformerParameters |
protected ShardReduceFunction |
transformResultsFunc |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDocumentQuery(AbstractDocumentQuery<T,TSelf> other) |
|
AbstractDocumentQuery(Class<T> clazz,
InMemoryDocumentSessionOperations theSession,
IDatabaseCommands databaseCommands,
String indexName,
String[] fieldsToFetch,
String[] projectionFields,
List<IDocumentQueryListener> queryListeners,
boolean isMapReduce) |
Modifier and Type | Method and Description |
---|---|
IDocumentQuery<T> |
addOrder(String fieldName,
boolean descending)
Adds an ordering for a specific field to the query
|
IDocumentQuery<T> |
addOrder(String fieldName,
boolean descending,
Class<?> fieldType)
Adds an ordering for a specific field to the query and specifies the type
of field for sorting purposes
|
void |
addRootType(Class<T> type) |
void |
afterQueryExecuted(Action1<QueryResult> afterQueryExecutedCallback)
Callback to get the results of the query
|
void |
afterStreamExecuted(Function1<Reference<RavenJObject>,Boolean> afterStreamExecutedCallback)
Callback to get the results of the stream
|
IDocumentQuery<T> |
andAlso()
Add an AND to the query
|
IDocumentQuery<T> |
beforeQueryExecution(Action1<IndexQuery> action) |
IDocumentQuery<T> |
boost(Double boost)
Specifies a boost weight to the last where clause.
|
protected void |
clearSortHints(IDatabaseCommands dbCommands) |
IDocumentQuery<T> |
closeSubclause()
Simplified method for closing a clause within the query
|
IDocumentQuery<T> |
containsAll(String fieldName,
Collection<Object> values)
Performs a query matching ALL of the provided values against the given field (AND)
|
IDocumentQuery<T> |
containsAny(String fieldName,
Collection<Object> values)
Performs a query matching ANY of the provided values against the given field (OR)
|
Lazy<Integer> |
countLazily()
Register the query as a lazy-count query in the session and return a lazy
instance that will evaluate the query only when needed
|
IDocumentQuery<T> |
customSortUsing(String typeName) |
IDocumentQuery<T> |
customSortUsing(String typeName,
boolean descending)
Sort using custom sorter on the server
|
IDocumentQuery<T> |
distinct() |
protected void |
executeActualQuery() |
protected void |
executeBeforeQueryListeners() |
T |
first() |
T |
firstOrDefault() |
IDocumentQuery<T> |
fuzzy(Double fuzzy)
Specifies a fuzziness factor to the single word term in the last where
clause
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches
|
protected IndexQuery |
generateIndexQuery(String query)
Generates the index query.
|
protected TSelf |
generateQueryWithinRadiusOf(String fieldName,
double radius,
double latitude,
double longitude) |
protected TSelf |
generateQueryWithinRadiusOf(String fieldName,
double radius,
double latitude,
double longitude,
double distanceErrorPct) |
protected TSelf |
generateQueryWithinRadiusOf(String fieldName,
double radius,
double latitude,
double longitude,
double distanceErrorPct,
SpatialOptions.SpatialUnits radiusUnits)
Filter matches to be inside the specified radius
|
protected TSelf |
generateSpatialQueryData(String fieldName,
SpatialCriteria criteria) |
protected TSelf |
generateSpatialQueryData(String fieldName,
SpatialCriteria criteria,
double distanceErrorPct) |
protected TSelf |
generateSpatialQueryData(String fieldName,
String shapeWKT,
SpatialOptions.SpatialRelation relation) |
protected TSelf |
generateSpatialQueryData(String fieldName,
String shapeWKT,
SpatialOptions.SpatialRelation relation,
double distanceErrorPct) |
protected TSelf |
generateSpatialQueryData(String fieldName,
String shapeWKT,
SpatialOptions.SpatialRelation relation,
double distanceErrorPct,
SpatialOptions.SpatialUnits radiusUnits) |
IDatabaseCommands |
getDatabaseCommands()
Grant access to the database commands
|
DocumentConvention |
getDocumentConvention()
Gets the document convention from the query session
|
Class<T> |
getElementType() |
FacetResults |
getFacets(List<Facet> facets,
int facetStart,
Integer facetPageSize)
Get the facet results as per the specified facets with the given start and pageSize
|
FacetResults |
getFacets(String facetSetupDoc,
int facetStart,
Integer facetPageSize)
Get the facets as per the specified facet document with the given start and pageSize
|
String |
getIndexQueried()
Get the name of the index being queried
|
IndexQuery |
getIndexQuery()
Get the index query for this query
|
Tuple<String,String> |
getLastEqualityTerm()
The last term that we asked the query to use equals on
|
String |
getMemberQueryPath(com.mysema.query.types.Expression<?> expression) |
String |
getMemberQueryPathForOrderBy(com.mysema.query.types.Expression<?> expression) |
protected String[] |
getMemberQueryPaths(com.mysema.query.types.Expression<?>... expressions) |
protected String[] |
getMemberQueryPathsForOrderBy(com.mysema.query.types.Expression<?>... expressions) |
Collection<String> |
getProjectionFields()
Gets the fields for projection
|
QueryResult |
getQueryResult()
Gets the query result Execute the query the first time that this is called.
|
InMemoryDocumentSessionOperations |
getSession()
Gets the session associated with this document query
|
IDocumentQuery<T> |
highlight(String fieldName,
int fragmentLength,
int fragmentCount,
Reference<FieldHighlightings> fieldHighlightings)
Adds matches highlighting for the specified field.
|
IDocumentQuery<T> |
highlight(String fieldName,
int fragmentLength,
int fragmentCount,
String fragmentsField)
Adds matches highlighting for the specified field.
|
IDocumentQuery<T> |
highlight(String fieldName,
String fieldKeyName,
int fragmentLength,
int fragmentCount,
Reference<FieldHighlightings> fieldHightlightings)
Adds matches highlighting for the specified field on a Map/Reduce Index.
|
IDocumentQuery<T> |
include(Class<?> targetClass,
com.mysema.query.types.Path<?> path)
Includes the specified path in the query, loading the document specified in that path
|
IDocumentQuery<T> |
include(com.mysema.query.types.Path<?> path)
Includes the specified path in the query, loading the document specified in that path
|
IDocumentQuery<T> |
include(String path)
Includes the specified path in the query, loading the document specified in that path
|
protected QueryOperation |
initializeQueryOperation() |
protected void |
initSync() |
IDocumentQuery<T> |
intersect() |
void |
invokeAfterQueryExecuted(QueryResult result)
Called externally to raise the after query executed callback
|
void |
invokeAfterStreamExecuted(Reference<RavenJObject> resultRef)
Called externally to raise the after stream executed callback
|
Iterator<T> |
iterator() |
Lazy<List<T>> |
lazily()
Register the query as a lazy query in the session and return a lazy
instance that will evaluate the query only when needed
|
Lazy<List<T>> |
lazily(Action1<List<T>> onEval)
Register the query as a lazy query in the session and return a lazy
instance that will evaluate the query only when needed
|
void |
negateNext()
Negate the next operation
|
IDocumentQuery<T> |
noCaching() |
IDocumentQuery<T> |
noTracking() |
IDocumentQuery<T> |
openSubclause()
Simplified method for opening a new clause within the query
|
IDocumentQuery<T> |
orderBy(String... fields)
Order the results by the specified fields The fields are the names of the
fields to sort, defaulting to sorting by ascending.
|
IDocumentQuery<T> |
orderByDescending(String... fields)
Order the results by the specified fields The fields are the names of the
fields to sort, defaulting to sorting by descending.
|
IDocumentQuery<T> |
orElse()
Add an OR to the query
|
IDocumentQuery<T> |
proximity(int proximity)
Specifies a proximity distance for the phrase in the last where clause
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20
Searches
|
IDocumentQuery<T> |
randomOrdering()
Order the search results randomly
|
IDocumentQuery<T> |
randomOrdering(String seed)
Order the search results randomly using the specified seed this is useful
if you want to have repeatable random queries
|
IDocumentQuery<T> |
search(String fieldName,
String searchTerms)
Perform a search for documents which fields that match the searchTerms.
|
IDocumentQuery<T> |
search(String fieldName,
String searchTerms,
EscapeQueryOptions escapeQueryOptions)
Perform a search for documents which fields that match the searchTerms.
|
IDocumentQuery<T> |
setAllowMultipleIndexEntriesForSameDocumentToResultTransformer(boolean value) |
IDocumentQuery<T> |
setHighlighterTags(String[] preTags,
String[] postTags)
Sets the tags to highlight matches with.
|
IDocumentQuery<T> |
setHighlighterTags(String preTag,
String postTag)
Sets the tags to highlight matches with.
|
void |
setOriginalQueryType(Class originalType)
Sets the original query type incase of TransforWith usage.
|
IDocumentQuery<T> |
showTimings() |
T |
single() |
T |
singleOrDefault() |
IDocumentQuery<T> |
skip(int count)
Skips the specified count.
|
IDocumentQuery<T> |
statistics(Reference<RavenQueryStatistics> stats)
Provide statistics about the query, such as total count of matching records
|
IDocumentQuery<T> |
take(int count)
Takes the specified count.
|
String |
toString()
Returns a
String that represents the query for this instance. |
IDocumentQuery<T> |
transformResults(ShardReduceFunction resultsTransformer) |
protected void |
updateStatsAndHighlightings(QueryResult queryResult) |
IDocumentQuery<T> |
usingDefaultField(String field) |
IDocumentQuery<T> |
usingDefaultOperator(QueryOperator operator) |
IDocumentQuery<T> |
waitForNonStaleResults()
EXPERT ONLY: Instructs the query to wait for non stale results.
|
IDocumentQuery<T> |
waitForNonStaleResults(long waitTimeout)
Instruct the query to wait for non stale result for the specified wait timeout.
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOf(Date cutOff)
Instructs the query to wait for non stale results as of the cutoff date.
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOf(Date cutOff,
long waitTimeout)
Instructs the query to wait for non stale results as of the cutoff date for
the specified timeout
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOf(Etag cutOffEtag)
Instructs the query to wait for non stale results as of the cutoff etag.
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOf(Etag cutOffEtag,
long waitTimeout)
Instructs the query to wait for non stale results as of the cutoff etag.
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOfLastWrite()
Instructs the query to wait for non stale results as of the last write made
by any session belonging to the current document store.
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOfLastWrite(long waitTimeout)
Instructs the query to wait for non stale results as of the last write made
by any session belonging to the current document store.
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOfNow()
Instructs the query to wait for non stale results as of now.
|
IDocumentQuery<T> |
waitForNonStaleResultsAsOfNow(long waitTimeout)
Instructs the query to wait for non stale results as of now for the
specified timeout.
|
IDocumentQuery<T> |
where(String whereClause)
Filter the results from the index using the specified where clause.
|
IDocumentQuery<T> |
whereBetween(String fieldName,
Object start,
Object end)
Matches fields where the value is between the specified start and end,
exclusive
|
IDocumentQuery<T> |
whereBetweenOrEqual(String fieldName,
Object start,
Object end)
Matches fields where the value is between the specified start and end,
inclusive
|
IDocumentQuery<T> |
whereEndsWith(String fieldName,
Object value)
Matches fields which ends with the specified value.
|
IDocumentQuery<T> |
whereEquals(String fieldName,
Object value)
Matches exact value
|
IDocumentQuery<T> |
whereEquals(String fieldName,
Object value,
boolean isAnalyzed)
Matches exact value
Default to allow wildcard only if analyzed
|
IDocumentQuery<T> |
whereEquals(WhereParams whereParams)
Matches exact value
|
IDocumentQuery<T> |
whereGreaterThan(String fieldName,
Object value)
Matches fields where the value is greater than the specified value
|
IDocumentQuery<T> |
whereGreaterThanOrEqual(String fieldName,
Object value)
Matches fields where the value is greater than or equal to the specified
value
|
IDocumentQuery<T> |
whereIn(String fieldName,
Collection<?> values)
Check that the field has one of the specified value
|
IDocumentQuery<T> |
whereLessThan(String fieldName,
Object value)
Matches fields where the value is less than the specified value
|
IDocumentQuery<T> |
whereLessThanOrEqual(String fieldName,
Object value)
Matches fields where the value is less than or equal to the specified value
|
IDocumentQuery<T> |
whereStartsWith(String fieldName,
Object value)
Matches fields which starts with the specified value.
|
protected boolean isSpatialQuery
protected String spatialFieldName
protected String queryShape
protected SpatialOptions.SpatialUnits spatialUnits
protected SpatialOptions.SpatialRelation spatialRelation
protected double distanceErrorPct
protected Action1<IndexQuery> beforeQueryExecutionAction
protected boolean negate
protected boolean distinct
protected final IDatabaseCommands theDatabaseCommands
protected final String indexName
protected ShardReduceFunction transformResultsFunc
protected String defaultField
protected Map<String,RavenJToken> transformerParameters
protected final String[] projectionFields
protected final String[] fieldsToFetch
protected final IDocumentQueryListener[] queryListeners
protected final boolean isMapReduce
protected final InMemoryDocumentSessionOperations theSession
protected Date cutoff
protected String[] orderByFields
protected List<HighlightedField> highlightedFields
protected String[] highlighterPreTags
protected String[] highlighterPostTags
protected String highlighterKeyName
protected Set<Tuple<String,SortOptions>> sortByHints
protected Integer pageSize
protected QueryOperation queryOperation
protected StringBuilder queryText
protected int start
protected long timeout
protected boolean theWaitForNonStaleResults
protected boolean theWaitForNonStaleResultsAsOfNow
protected String[] groupByFields
protected RavenQueryStatistics queryStats
protected RavenQueryHighlightings highlightings
protected String resultsTransformer
protected boolean disableEntitiesTracking
protected boolean disableCaching
protected boolean showQueryTimings
protected boolean shouldExplainScores
protected Action1<QueryResult> afterQueryExecutedCallback
protected Function1<Reference<RavenJObject>,Boolean> afterStreamExecutedCallback
protected Etag cutoffEtag
protected QueryOperator defaultOperator
protected boolean allowMultipleIndexEntriesForSameDocumentToResultTransformer
public AbstractDocumentQuery(Class<T> clazz, InMemoryDocumentSessionOperations theSession, IDatabaseCommands databaseCommands, String indexName, String[] fieldsToFetch, String[] projectionFields, List<IDocumentQueryListener> queryListeners, boolean isMapReduce)
protected AbstractDocumentQuery(AbstractDocumentQuery<T,TSelf> other)
public String getIndexQueried()
getIndexQueried
in interface IRavenQueryInspector
getIndexQueried
in interface IAbstractDocumentQuery<T>
public IDatabaseCommands getDatabaseCommands()
getDatabaseCommands
in interface IRavenQueryInspector
public DocumentConvention getDocumentConvention()
getDocumentConvention
in interface IAbstractDocumentQuery<T>
public InMemoryDocumentSessionOperations getSession()
getSession
in interface IRavenQueryInspector
protected void updateStatsAndHighlightings(QueryResult queryResult)
public IDocumentQuery<T> include(String path)
IAbstractDocumentQuery
include
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> waitForNonStaleResults(long waitTimeout)
IAbstractDocumentQuery
waitForNonStaleResults
in interface IAbstractDocumentQuery<T>
waitTimeout
- The wait timeout in milisprotected TSelf generateQueryWithinRadiusOf(String fieldName, double radius, double latitude, double longitude)
protected TSelf generateQueryWithinRadiusOf(String fieldName, double radius, double latitude, double longitude, double distanceErrorPct)
protected TSelf generateQueryWithinRadiusOf(String fieldName, double radius, double latitude, double longitude, double distanceErrorPct, SpatialOptions.SpatialUnits radiusUnits)
fieldName
- radius
- latitude
- longitude
- distanceErrorPct
- protected TSelf generateSpatialQueryData(String fieldName, String shapeWKT, SpatialOptions.SpatialRelation relation)
protected TSelf generateSpatialQueryData(String fieldName, String shapeWKT, SpatialOptions.SpatialRelation relation, double distanceErrorPct)
protected TSelf generateSpatialQueryData(String fieldName, String shapeWKT, SpatialOptions.SpatialRelation relation, double distanceErrorPct, SpatialOptions.SpatialUnits radiusUnits)
protected TSelf generateSpatialQueryData(String fieldName, SpatialCriteria criteria)
protected TSelf generateSpatialQueryData(String fieldName, SpatialCriteria criteria, double distanceErrorPct)
public IDocumentQuery<T> usingDefaultField(String field)
public IDocumentQuery<T> usingDefaultOperator(QueryOperator operator)
public IDocumentQuery<T> include(Class<?> targetClass, com.mysema.query.types.Path<?> path)
IAbstractDocumentQuery
include
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> include(com.mysema.query.types.Path<?> path)
IAbstractDocumentQuery
include
in interface IAbstractDocumentQuery<T>
protected QueryOperation initializeQueryOperation()
public IndexQuery getIndexQuery()
IRavenQueryInspector
getIndexQuery
in interface IRavenQueryInspector
public FacetResults getFacets(String facetSetupDoc, int facetStart, Integer facetPageSize)
IRavenQueryInspector
getFacets
in interface IRavenQueryInspector
public FacetResults getFacets(List<Facet> facets, int facetStart, Integer facetPageSize)
IRavenQueryInspector
getFacets
in interface IRavenQueryInspector
public QueryResult getQueryResult()
protected void initSync()
protected void clearSortHints(IDatabaseCommands dbCommands)
protected void executeActualQuery()
public Lazy<List<T>> lazily()
public Lazy<List<T>> lazily(Action1<List<T>> onEval)
onEval
- public Lazy<Integer> countLazily()
protected void executeBeforeQueryListeners()
public Collection<String> getProjectionFields()
getProjectionFields
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> randomOrdering()
randomOrdering
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> randomOrdering(String seed)
randomOrdering
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> customSortUsing(String typeName)
customSortUsing
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> customSortUsing(String typeName, boolean descending)
IAbstractDocumentQuery
customSortUsing
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> beforeQueryExecution(Action1<IndexQuery> action)
public IDocumentQuery<T> transformResults(ShardReduceFunction resultsTransformer)
public IDocumentQuery<T> highlight(String fieldName, int fragmentLength, int fragmentCount, String fragmentsField)
IAbstractDocumentQuery
highlight
in interface IAbstractDocumentQuery<T>
fieldName
- The field name to highlight.fragmentLength
- The fragment length.fragmentCount
- The maximum number of fragments for the field.fragmentsField
- The field in query results item to put highlighing into.public IDocumentQuery<T> highlight(String fieldName, int fragmentLength, int fragmentCount, Reference<FieldHighlightings> fieldHighlightings)
IAbstractDocumentQuery
highlight
in interface IAbstractDocumentQuery<T>
fieldName
- The field name to highlight.fragmentLength
- The fragment length.fragmentCount
- The fragment count.fieldHighlightings
- The maximum number of fragments for the field.public IDocumentQuery<T> highlight(String fieldName, String fieldKeyName, int fragmentLength, int fragmentCount, Reference<FieldHighlightings> fieldHightlightings)
IAbstractDocumentQuery
highlight
in interface IAbstractDocumentQuery<T>
fieldName
- The field name to highlight.fieldKeyName
- The field key to associate highlights with.fragmentLength
- The fragment length.fragmentCount
- The fragment count.fieldHightlightings
- Field highlightings for all results.public IDocumentQuery<T> setAllowMultipleIndexEntriesForSameDocumentToResultTransformer(boolean value)
setAllowMultipleIndexEntriesForSameDocumentToResultTransformer
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> setHighlighterTags(String preTag, String postTag)
IAbstractDocumentQuery
setHighlighterTags
in interface IAbstractDocumentQuery<T>
preTag
- Prefix tag.postTag
- Postfix tag.public IDocumentQuery<T> setHighlighterTags(String[] preTags, String[] postTags)
IAbstractDocumentQuery
setHighlighterTags
in interface IAbstractDocumentQuery<T>
preTags
- Prefix tags.postTags
- Postfix tags.public IDocumentQuery<T> noTracking()
public IDocumentQuery<T> noCaching()
public IDocumentQuery<T> showTimings()
public IDocumentQuery<T> addOrder(String fieldName, boolean descending)
addOrder
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.descending
- If set to true [descending]public IDocumentQuery<T> addOrder(String fieldName, boolean descending, Class<?> fieldType)
addOrder
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.descending
- If set to true [descending]fieldType
- The type of the field to be sorted.public Iterator<T> iterator()
iterator
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> take(int count)
IAbstractDocumentQuery
take
in interface IAbstractDocumentQuery<T>
count
- The count.public IDocumentQuery<T> skip(int count)
IAbstractDocumentQuery
skip
in interface IAbstractDocumentQuery<T>
count
- The count.public T first()
public T firstOrDefault()
public T single()
public T singleOrDefault()
public IDocumentQuery<T> where(String whereClause)
IAbstractDocumentQuery
where
in interface IAbstractDocumentQuery<T>
whereClause
- The where clause.public IDocumentQuery<T> whereEquals(String fieldName, Object value)
whereEquals
in interface IAbstractDocumentQuery<T>
fieldName
- value
- public IDocumentQuery<T> whereEquals(String fieldName, Object value, boolean isAnalyzed)
IAbstractDocumentQuery
whereEquals
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> openSubclause()
openSubclause
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> closeSubclause()
closeSubclause
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> whereEquals(WhereParams whereParams)
whereEquals
in interface IAbstractDocumentQuery<T>
whereParams
- public void negateNext()
negateNext
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> whereIn(String fieldName, Collection<?> values)
whereIn
in interface IAbstractDocumentQuery<T>
fieldName
- values
- public IDocumentQuery<T> whereStartsWith(String fieldName, Object value)
whereStartsWith
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.value
- The value.spublic IDocumentQuery<T> whereEndsWith(String fieldName, Object value)
whereEndsWith
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the fieldvalue
- The value.public IDocumentQuery<T> whereBetween(String fieldName, Object start, Object end)
whereBetween
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.start
- The start.end
- The end.public IDocumentQuery<T> whereBetweenOrEqual(String fieldName, Object start, Object end)
whereBetweenOrEqual
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.start
- The start.end
- The end.public IDocumentQuery<T> whereGreaterThan(String fieldName, Object value)
whereGreaterThan
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.value
- The value.public IDocumentQuery<T> whereGreaterThanOrEqual(String fieldName, Object value)
whereGreaterThanOrEqual
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.value
- The value.public IDocumentQuery<T> whereLessThan(String fieldName, Object value)
whereLessThan
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.value
- The value.public IDocumentQuery<T> whereLessThanOrEqual(String fieldName, Object value)
whereLessThanOrEqual
in interface IAbstractDocumentQuery<T>
fieldName
- Name of the field.value
- the value.public IDocumentQuery<T> andAlso()
andAlso
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> orElse()
orElse
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> boost(Double boost)
boost
in interface IAbstractDocumentQuery<T>
boost
- boosting factor where 1.0 is default, less than 1.0 is lower
weight, greater than 1.0 is higher weightpublic IDocumentQuery<T> fuzzy(Double fuzzy)
fuzzy
in interface IAbstractDocumentQuery<T>
fuzzy
- 0.0 to 1.0 where 1.0 means closer matchpublic IDocumentQuery<T> proximity(int proximity)
proximity
in interface IAbstractDocumentQuery<T>
proximity
- number of words withinpublic IDocumentQuery<T> orderBy(String... fields)
orderBy
in interface IAbstractDocumentQuery<T>
fields
- The fields.public IDocumentQuery<T> orderByDescending(String... fields)
fields
- The fields.public IDocumentQuery<T> waitForNonStaleResultsAsOfNow()
waitForNonStaleResultsAsOfNow
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> waitForNonStaleResultsAsOfNow(long waitTimeout)
waitForNonStaleResultsAsOfNow
in interface IAbstractDocumentQuery<T>
waitTimeout
- The wait timeout in milispublic IDocumentQuery<T> waitForNonStaleResultsAsOf(Date cutOff)
waitForNonStaleResultsAsOf
in interface IAbstractDocumentQuery<T>
cutOff
- The cut off.public IDocumentQuery<T> waitForNonStaleResultsAsOf(Date cutOff, long waitTimeout)
waitForNonStaleResultsAsOf
in interface IAbstractDocumentQuery<T>
cutOff
- The cut off.waitTimeout
- the wait timeout in milispublic IDocumentQuery<T> waitForNonStaleResultsAsOf(Etag cutOffEtag)
public IDocumentQuery<T> waitForNonStaleResultsAsOf(Etag cutOffEtag, long waitTimeout)
public IDocumentQuery<T> waitForNonStaleResultsAsOfLastWrite()
public IDocumentQuery<T> waitForNonStaleResultsAsOfLastWrite(long waitTimeout)
public IDocumentQuery<T> waitForNonStaleResults()
waitForNonStaleResults
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> statistics(Reference<RavenQueryStatistics> stats)
stats
- public void afterQueryExecuted(Action1<QueryResult> afterQueryExecutedCallback)
afterQueryExecutedCallback
- public void afterStreamExecuted(Function1<Reference<RavenJObject>,Boolean> afterStreamExecutedCallback)
public void invokeAfterQueryExecuted(QueryResult result)
result
- public void invokeAfterStreamExecuted(Reference<RavenJObject> resultRef)
protected IndexQuery generateIndexQuery(String query)
query
- The query.public IDocumentQuery<T> search(String fieldName, String searchTerms)
IAbstractDocumentQuery
search
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> search(String fieldName, String searchTerms, EscapeQueryOptions escapeQueryOptions)
search
in interface IAbstractDocumentQuery<T>
fieldName
- searchTerms
- escapeQueryOptions
- public Tuple<String,String> getLastEqualityTerm()
getLastEqualityTerm
in interface IRavenQueryInspector
getLastEqualityTerm
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> intersect()
intersect
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> containsAny(String fieldName, Collection<Object> values)
IAbstractDocumentQuery
containsAny
in interface IAbstractDocumentQuery<T>
public IDocumentQuery<T> containsAll(String fieldName, Collection<Object> values)
IAbstractDocumentQuery
containsAll
in interface IAbstractDocumentQuery<T>
public void addRootType(Class<T> type)
addRootType
in interface IAbstractDocumentQuery<T>
protected String[] getMemberQueryPaths(com.mysema.query.types.Expression<?>... expressions)
protected String[] getMemberQueryPathsForOrderBy(com.mysema.query.types.Expression<?>... expressions)
public String getMemberQueryPathForOrderBy(com.mysema.query.types.Expression<?> expression)
public String getMemberQueryPath(com.mysema.query.types.Expression<?> expression)
public IDocumentQuery<T> distinct()
distinct
in interface IAbstractDocumentQuery<T>
public void setOriginalQueryType(Class originalType)
IAbstractDocumentQuery
setOriginalQueryType
in interface IAbstractDocumentQuery<T>
Copyright © 2016. All Rights Reserved.