public interface IDocumentQueryCustomization
Modifier and Type | Method and Description |
---|---|
IDocumentQueryCustomization |
beforeQueryExecution(Action1<IndexQuery> action)
Allow you to modify the index query before it is executed
|
IDocumentQueryCustomization |
customSortUsing(String typeName)
Sort using custom sorter on the server
|
IDocumentQueryCustomization |
customSortUsing(String typeName,
boolean descending)
Sort using custom sorter on the server
|
IDocumentQueryCustomization |
highlight(String fieldName,
int fragmentLength,
int fragmentCount,
Reference<FieldHighlightings> highlightings)
Adds matches highlighting for the specified field.
|
IDocumentQueryCustomization |
highlight(String fieldName,
int fragmentLength,
int fragmentCount,
String fragmentsField)
Adds matches highlighting for the specified field.
|
IDocumentQueryCustomization |
highlight(String fieldName,
String fieldKeyName,
int fragmentLength,
int fragmentCount,
Reference<FieldHighlightings> highlightings)
Adds matches highlighting for the specified field.
|
IDocumentQueryCustomization |
include(Class<?> targetClass,
com.mysema.query.types.Path<?> path)
Includes the specified path in the query, loading the document specified in that path
|
IDocumentQueryCustomization |
include(com.mysema.query.types.Path<?> path)
Includes the specified path in the query, loading the document specified in that path
|
IDocumentQueryCustomization |
include(String path)
Includes the specified path in the query, loading the document specified in that path
|
IDocumentQueryCustomization |
noCaching()
Disables caching for query results.
|
IDocumentQueryCustomization |
noTracking()
Disables tracking for queried entities by Raven's Unit of Work.
|
IDocumentQueryCustomization |
randomOrdering()
Order the search results randomly
|
IDocumentQueryCustomization |
randomOrdering(String seed)
Order the search results randomly using the specified seed
this is useful if you want to have repeatable random queries
|
IDocumentQueryCustomization |
relatesToShape(String fieldName,
String shapeWKT,
SpatialOptions.SpatialRelation rel)
Filter matches based on a given shape - only documents with the shape defined in fieldName that
have a relation rel with the given shapeWKT will be returned
|
IDocumentQueryCustomization |
setAllowMultipleIndexEntriesForSameDocumentToResultTransformer(boolean val)
If set to true, this property will send multiple index entries from the same document (assuming the index project them)
to the result transformer function.
|
IDocumentQueryCustomization |
setHighlighterTags(String[] preTags,
String[] postTags)
Sets the tags to highlight matches with.
|
IDocumentQueryCustomization |
setHighlighterTags(String preTag,
String postTag)
Sets the tags to highlight matches with.
|
IDocumentQueryCustomization |
showTimings()
Enables calculation of timings for various parts of a query (Lucene search, loading documents, transforming results).
|
IDocumentQueryCustomization |
sortByDistance()
When using spatial queries, instruct the query to sort by the distance from the origin point
|
IDocumentQueryCustomization |
sortByDistance(double lat,
double lng)
When using spatial queries, instruct the query to sort by the distance from the origin point
|
IDocumentQueryCustomization |
sortByDistance(double lat,
double lng,
String sortedFieldName)
When using spatial queries, instruct the query to sort by the distance from the origin point
|
IDocumentQueryCustomization |
spatial(String fieldName,
SpatialCriteria criteria)
Ability to use one factory to determine spatial shape that will be used in query.
|
IDocumentQueryCustomization |
transformResults(ShardReduceFunction func) |
IDocumentQueryCustomization |
waitForNonStaleResults()
EXPERT ONLY: Instructs the query to wait for non stale results.
|
IDocumentQueryCustomization |
waitForNonStaleResults(long waitTimeout)
EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout.
|
IDocumentQueryCustomization |
waitForNonStaleResultsAsOf(Date cutOff)
Instructs the query to wait for non stale results as of the cutoff date.
|
IDocumentQueryCustomization |
waitForNonStaleResultsAsOf(Date cutOff,
long waitTimeout)
Instructs the query to wait for non stale results as of the cutoff date for the specified timeout
|
IDocumentQueryCustomization |
waitForNonStaleResultsAsOf(Etag cutOffEtag)
Instructs the query to wait for non stale results as of the cutoff etag.
|
IDocumentQueryCustomization |
waitForNonStaleResultsAsOf(Etag cutOffEtag,
long waitTimeout)
Instructs the query to wait for non stale results as of the cutoff etag for the specified timeout.
|
IDocumentQueryCustomization |
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.
|
IDocumentQueryCustomization |
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.
|
IDocumentQueryCustomization |
waitForNonStaleResultsAsOfNow()
Instructs the query to wait for non stale results as of now.
|
IDocumentQueryCustomization |
waitForNonStaleResultsAsOfNow(long waitTimeout)
Instructs the query to wait for non stale results as of now for the specified timeout.
|
IDocumentQueryCustomization |
withinRadiusOf(double radius,
double latitude,
double longitude)
Filter matches to be inside the specified radius.
|
IDocumentQueryCustomization |
withinRadiusOf(double radius,
double latitude,
double longitude,
SpatialOptions.SpatialUnits radiusUnits)
Filter matches to be inside the specified radius
|
IDocumentQueryCustomization |
withinRadiusOf(String fieldName,
double radius,
double latitude,
double longitude)
Filter matches to be inside the specified radius
|
IDocumentQueryCustomization |
withinRadiusOf(String fieldName,
double radius,
double latitude,
double longitude,
SpatialOptions.SpatialUnits radiusUnits)
Filter matches to be inside the specified radius
|
IDocumentQueryCustomization waitForNonStaleResultsAsOfLastWrite()
IDocumentQueryCustomization waitForNonStaleResultsAsOfLastWrite(long waitTimeout)
waitTimeout
- Maximum time to wait for index query results to become non-stale before exception is thrown.IDocumentQueryCustomization waitForNonStaleResultsAsOfNow()
IDocumentQueryCustomization waitForNonStaleResultsAsOfNow(long waitTimeout)
waitTimeout
- Maximum time to wait for index query results to become non-stale before exception is thrown.IDocumentQueryCustomization waitForNonStaleResultsAsOf(Date cutOff)
cutOff
- Index will be considered stale if modification date of last indexed document is greater than this value.IDocumentQueryCustomization transformResults(ShardReduceFunction func)
IDocumentQueryCustomization waitForNonStaleResultsAsOf(Date cutOff, long waitTimeout)
cutOff
- Index will be considered stale if modification date of last indexed document is greater than this value.waitTimeout
- Maximum time to wait for index query results to become non-stale before exception is thrown.IDocumentQueryCustomization waitForNonStaleResultsAsOf(Etag cutOffEtag)
cutOffEtag
- Cutoff etag is used to check if the index has already process a document with the given
etag. Unlike Cutoff, which uses dates and is susceptible to clock synchronization issues between
machines, cutoff etag doesn't rely on both the server and client having a synchronized clock and
can work without it.
However, when used to query map/reduce indexes, it does NOT guarantee that the document that this
etag belong to is actually considered for the results.
What it does it guarantee that the document has been mapped, but not that the mapped values has been reduced.
Since map/reduce queries, by their nature, tend to be far less susceptible to issues with staleness, this is
considered to be an acceptable tradeoff.
If you need absolute no staleness with a map/reduce index, you will need to ensure synchronized clocks and
use the Cutoff date option, instead.IDocumentQueryCustomization waitForNonStaleResultsAsOf(Etag cutOffEtag, long waitTimeout)
cutOffEtag
- Cutoff etag is used to check if the index has already process a document with the given
etag. Unlike Cutoff, which uses dates and is susceptible to clock synchronization issues between
machines, cutoff etag doesn't rely on both the server and client having a synchronized clock and
can work without it.
However, when used to query map/reduce indexes, it does NOT guarantee that the document that this
etag belong to is actually considered for the results.
What it does it guarantee that the document has been mapped, but not that the mapped values has been reduced.
Since map/reduce queries, by their nature, tend to be far less susceptible to issues with staleness, this is
considered to be an acceptable tradeoff.
If you need absolute no staleness with a map/reduce index, you will need to ensure synchronized clocks and
use the Cutoff date option, instead.waitTimeout
- Maximum time to wait for index query results to become non-stale before exception is thrown.IDocumentQueryCustomization waitForNonStaleResults()
IDocumentQueryCustomization include(com.mysema.query.types.Path<?> path)
path
- IDocumentQueryCustomization include(String path)
path
- IDocumentQueryCustomization include(Class<?> targetClass, com.mysema.query.types.Path<?> path)
path
- IDocumentQueryCustomization waitForNonStaleResults(long waitTimeout)
waitTimeout
- Maximum time to wait for index query results to become non-stale before exception is thrown.IDocumentQueryCustomization withinRadiusOf(double radius, double latitude, double longitude)
radius
- Radius (in kilometers) in which matches should be found.latitude
- Latitude pointing to a circle center.longitude
- Longitude pointing to a circle center.IDocumentQueryCustomization withinRadiusOf(String fieldName, double radius, double latitude, double longitude)
fieldName
- Spatial field name.radius
- Radius (in kilometers) in which matches should be found.latitude
- Latitude pointing to a circle center.longitude
- Longitude pointing to a circle center.IDocumentQueryCustomization withinRadiusOf(double radius, double latitude, double longitude, SpatialOptions.SpatialUnits radiusUnits)
radius
- Radius (measured in units passed to radiusUnits parameter) in which matches should be found.latitude
- Latitude poiting to a circle center.longitude
- Longitude poiting to a circle center.radiusUnits
- Units that will be used to measure distances (Kilometers, Miles).IDocumentQueryCustomization withinRadiusOf(String fieldName, double radius, double latitude, double longitude, SpatialOptions.SpatialUnits radiusUnits)
fieldName
- Spatial field name.radius
- Radius (measured in units passed to radiusUnits parameter) in which matches should be found.latitude
- Latitude pointing to a circle center.longitude
- Longitude pointing to a circle center.radiusUnits
- Units that will be used to measure distances (Kilometers, Miles).IDocumentQueryCustomization relatesToShape(String fieldName, String shapeWKT, SpatialOptions.SpatialRelation rel)
fieldName
- The name of the field containing the shape to use for filteringshapeWKT
- The query shaperel
- Spatial relation to checkIDocumentQueryCustomization spatial(String fieldName, SpatialCriteria criteria)
fieldName
- Spatial field name.criteria
- Function with spatial criteria factoryIDocumentQueryCustomization sortByDistance()
IDocumentQueryCustomization sortByDistance(double lat, double lng)
IDocumentQueryCustomization sortByDistance(double lat, double lng, String sortedFieldName)
IDocumentQueryCustomization randomOrdering()
IDocumentQueryCustomization randomOrdering(String seed)
seed
- IDocumentQueryCustomization customSortUsing(String typeName)
typeName
- IDocumentQueryCustomization customSortUsing(String typeName, boolean descending)
typeName
- descending
- IDocumentQueryCustomization beforeQueryExecution(Action1<IndexQuery> action)
action
- IDocumentQueryCustomization highlight(String fieldName, int fragmentLength, int fragmentCount, String fragmentsField)
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 highlightings into.IDocumentQueryCustomization highlight(String fieldName, int fragmentLength, int fragmentCount, Reference<FieldHighlightings> highlightings)
fieldName
- The field name to highlight.fragmentLength
- The fragment length.fragmentCount
- The maximum number of fragments for the field.highlightings
- Field highlightings for all results.IDocumentQueryCustomization highlight(String fieldName, String fieldKeyName, int fragmentLength, int fragmentCount, Reference<FieldHighlightings> highlightings)
fieldName
- The field name to highlight.fragmentLength
- The fragment length.fragmentCount
- The maximum number of fragments for the field.highlightings
- Field highlightings for all results.IDocumentQueryCustomization setAllowMultipleIndexEntriesForSameDocumentToResultTransformer(boolean val)
val
- IDocumentQueryCustomization setHighlighterTags(String preTag, String postTag)
preTag
- Prefix tag.postTag
- Postfix tag.IDocumentQueryCustomization setHighlighterTags(String[] preTags, String[] postTags)
preTags
- Prefix tags.postTags
- Postfix tags.IDocumentQueryCustomization noTracking()
IDocumentQueryCustomization noCaching()
IDocumentQueryCustomization showTimings()
Copyright © 2016. All Rights Reserved.