@Immutable public class DocumentQueryCustomizationFactory extends Object implements IDocumentQueryCustomization
Modifier | Constructor and Description |
---|---|
|
DocumentQueryCustomizationFactory() |
protected |
DocumentQueryCustomizationFactory(Set<Action1<IDocumentQueryCustomization>> actions,
Action1<IDocumentQueryCustomization> newAction) |
Modifier and Type | Method and Description |
---|---|
DocumentQueryCustomizationFactory |
beforeQueryExecution(Action1<IndexQuery> action)
Allow you to modify the index query before it is executed
|
void |
customize(IDocumentQueryCustomization documentQuery) |
DocumentQueryCustomizationFactory |
customSortUsing(String typeName)
Sort using custom sorter on the server
|
DocumentQueryCustomizationFactory |
customSortUsing(String typeName,
boolean descending)
Sort using custom sorter on the server
|
DocumentQueryCustomizationFactory |
highlight(String fieldName,
int fragmentLength,
int fragmentCount,
Reference<FieldHighlightings> highlightings)
Adds matches highlighting for the specified field.
|
DocumentQueryCustomizationFactory |
highlight(String fieldName,
int fragmentLength,
int fragmentCount,
String fragmentsField)
Adds matches highlighting for the specified field.
|
DocumentQueryCustomizationFactory |
highlight(String fieldName,
String fieldKeyName,
int fragmentLength,
int fragmentCount,
Reference<FieldHighlightings> highlightings)
Adds matches highlighting for the specified field.
|
DocumentQueryCustomizationFactory |
include(Class<?> targetEntityClass,
com.mysema.query.types.Path<?> path)
Includes the specified path in the query, loading the document specified in that path
|
DocumentQueryCustomizationFactory |
include(com.mysema.query.types.Path<?> path)
Includes the specified path in the query, loading the document specified in that path
|
DocumentQueryCustomizationFactory |
include(String path)
Includes the specified path in the query, loading the document specified in that path
|
static DocumentQueryCustomizationFactory |
join(DocumentQueryCustomizationFactory firstCustomize,
DocumentQueryCustomizationFactory secondCustomize) |
DocumentQueryCustomizationFactory |
noCaching()
Disables caching for query results.
|
DocumentQueryCustomizationFactory |
noTracking()
Disables tracking for queried entities by Raven's Unit of Work.
|
DocumentQueryCustomizationFactory |
randomOrdering()
Order the search results randomly
|
DocumentQueryCustomizationFactory |
randomOrdering(String seed)
Order the search results randomly using the specified seed
this is useful if you want to have repeatable random queries
|
DocumentQueryCustomizationFactory |
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
|
DocumentQueryCustomizationFactory |
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.
|
DocumentQueryCustomizationFactory |
setHighlighterTags(String[] preTags,
String[] postTags)
Sets the tags to highlight matches with.
|
DocumentQueryCustomizationFactory |
setHighlighterTags(String preTag,
String postTag)
Sets the tags to highlight matches with.
|
DocumentQueryCustomizationFactory |
showTimings()
Enables calculation of timings for various parts of a query (Lucene search, loading documents, transforming results).
|
DocumentQueryCustomizationFactory |
sortByDistance()
When using spatial queries, instruct the query to sort by the distance from the origin point
|
DocumentQueryCustomizationFactory |
sortByDistance(double lat,
double lng)
When using spatial queries, instruct the query to sort by the distance from the origin point
|
DocumentQueryCustomizationFactory |
sortByDistance(double lat,
double lng,
String sortedFieldName)
When using spatial queries, instruct the query to sort by the distance from the origin point
|
DocumentQueryCustomizationFactory |
spatial(String fieldName,
SpatialCriteria criteria)
Ability to use one factory to determine spatial shape that will be used in query.
|
DocumentQueryCustomizationFactory |
transformResults(ShardReduceFunction func) |
DocumentQueryCustomizationFactory |
waitForNonStaleResults()
EXPERT ONLY: Instructs the query to wait for non stale results.
|
DocumentQueryCustomizationFactory |
waitForNonStaleResults(long waitTimeout)
EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout.
|
DocumentQueryCustomizationFactory |
waitForNonStaleResultsAsOf(Date cutOff)
Instructs the query to wait for non stale results as of the cutoff date.
|
DocumentQueryCustomizationFactory |
waitForNonStaleResultsAsOf(Date cutOff,
long waitTimeout)
Instructs the query to wait for non stale results as of the cutoff date for the specified timeout
|
DocumentQueryCustomizationFactory |
waitForNonStaleResultsAsOf(Etag cutOffEtag)
Instructs the query to wait for non stale results as of the cutoff etag.
|
DocumentQueryCustomizationFactory |
waitForNonStaleResultsAsOf(Etag cutOffEtag,
long waitTimeout)
Instructs the query to wait for non stale results as of the cutoff etag for the specified timeout.
|
DocumentQueryCustomizationFactory |
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.
|
DocumentQueryCustomizationFactory |
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.
|
DocumentQueryCustomizationFactory |
waitForNonStaleResultsAsOfNow()
Instructs the query to wait for non stale results as of now.
|
DocumentQueryCustomizationFactory |
waitForNonStaleResultsAsOfNow(long waitTimeout)
Instructs the query to wait for non stale results as of now for the specified timeout.
|
DocumentQueryCustomizationFactory |
withinRadiusOf(double radius,
double latitude,
double longitude)
Filter matches to be inside the specified radius
|
DocumentQueryCustomizationFactory |
withinRadiusOf(double radius,
double latitude,
double longitude,
SpatialOptions.SpatialUnits radiusUnits)
Filter matches to be inside the specified radius
|
DocumentQueryCustomizationFactory |
withinRadiusOf(String fieldName,
double radius,
double latitude,
double longitude)
Filter matches to be inside the specified radius
|
DocumentQueryCustomizationFactory |
withinRadiusOf(String fieldName,
double radius,
double latitude,
double longitude,
SpatialOptions.SpatialUnits radiusUnits)
Filter matches to be inside the specified radius
|
public DocumentQueryCustomizationFactory()
protected DocumentQueryCustomizationFactory(Set<Action1<IDocumentQueryCustomization>> actions, Action1<IDocumentQueryCustomization> newAction)
public DocumentQueryCustomizationFactory waitForNonStaleResultsAsOfLastWrite()
waitForNonStaleResultsAsOfLastWrite
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory waitForNonStaleResultsAsOfLastWrite(long waitTimeout)
waitForNonStaleResultsAsOfLastWrite
in interface IDocumentQueryCustomization
waitTimeout
- public DocumentQueryCustomizationFactory waitForNonStaleResultsAsOfNow()
waitForNonStaleResultsAsOfNow
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory waitForNonStaleResultsAsOfNow(long waitTimeout)
waitForNonStaleResultsAsOfNow
in interface IDocumentQueryCustomization
waitTimeout
- timeout in milispublic DocumentQueryCustomizationFactory waitForNonStaleResultsAsOf(Date cutOff)
waitForNonStaleResultsAsOf
in interface IDocumentQueryCustomization
cutOff
- public DocumentQueryCustomizationFactory waitForNonStaleResultsAsOf(Date cutOff, long waitTimeout)
waitForNonStaleResultsAsOf
in interface IDocumentQueryCustomization
cutOff
- waitTimeout
- timeout in milispublic DocumentQueryCustomizationFactory waitForNonStaleResultsAsOf(Etag cutOffEtag)
waitForNonStaleResultsAsOf
in interface IDocumentQueryCustomization
cutOffEtag
- public DocumentQueryCustomizationFactory transformResults(ShardReduceFunction func)
transformResults
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory waitForNonStaleResultsAsOf(Etag cutOffEtag, long waitTimeout)
waitForNonStaleResultsAsOf
in interface IDocumentQueryCustomization
cutOffEtag
- waitTimeout
- public DocumentQueryCustomizationFactory waitForNonStaleResults()
waitForNonStaleResults
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory include(com.mysema.query.types.Path<?> path)
include
in interface IDocumentQueryCustomization
path
- public DocumentQueryCustomizationFactory include(String path)
include
in interface IDocumentQueryCustomization
path
- public DocumentQueryCustomizationFactory include(Class<?> targetEntityClass, com.mysema.query.types.Path<?> path)
include
in interface IDocumentQueryCustomization
targetEntityClass
- path
- public DocumentQueryCustomizationFactory waitForNonStaleResults(long waitTimeout)
waitForNonStaleResults
in interface IDocumentQueryCustomization
waitTimeout
- public DocumentQueryCustomizationFactory withinRadiusOf(double radius, double latitude, double longitude)
withinRadiusOf
in interface IDocumentQueryCustomization
radius
- latitude
- longitude
- public DocumentQueryCustomizationFactory withinRadiusOf(String fieldName, double radius, double latitude, double longitude)
withinRadiusOf
in interface IDocumentQueryCustomization
fieldName
- radius
- latitude
- longitude
- public DocumentQueryCustomizationFactory withinRadiusOf(double radius, double latitude, double longitude, SpatialOptions.SpatialUnits radiusUnits)
withinRadiusOf
in interface IDocumentQueryCustomization
radius
- latitude
- longitude
- radiusUnits
- public DocumentQueryCustomizationFactory withinRadiusOf(String fieldName, double radius, double latitude, double longitude, SpatialOptions.SpatialUnits radiusUnits)
withinRadiusOf
in interface IDocumentQueryCustomization
fieldName
- radius
- latitude
- longitude
- radiusUnits
- public DocumentQueryCustomizationFactory relatesToShape(String fieldName, String shapeWKT, SpatialOptions.SpatialRelation rel)
relatesToShape
in interface IDocumentQueryCustomization
fieldName
- The name of the field containing the shape to use for filteringshapeWKT
- The query shaperel
- Spatial relation to checkpublic DocumentQueryCustomizationFactory spatial(String fieldName, SpatialCriteria criteria)
IDocumentQueryCustomization
spatial
in interface IDocumentQueryCustomization
fieldName
- Spatial field name.criteria
- Function with spatial criteria factorypublic DocumentQueryCustomizationFactory sortByDistance()
sortByDistance
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory sortByDistance(double lat, double lng)
sortByDistance
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory sortByDistance(double lat, double lng, String sortedFieldName)
sortByDistance
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory randomOrdering()
randomOrdering
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory randomOrdering(String seed)
randomOrdering
in interface IDocumentQueryCustomization
seed
- public DocumentQueryCustomizationFactory customSortUsing(String typeName)
IDocumentQueryCustomization
customSortUsing
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory customSortUsing(String typeName, boolean descending)
IDocumentQueryCustomization
customSortUsing
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory beforeQueryExecution(Action1<IndexQuery> action)
beforeQueryExecution
in interface IDocumentQueryCustomization
action
- public DocumentQueryCustomizationFactory highlight(String fieldName, int fragmentLength, int fragmentCount, String fragmentsField)
highlight
in interface IDocumentQueryCustomization
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.public DocumentQueryCustomizationFactory highlight(String fieldName, int fragmentLength, int fragmentCount, Reference<FieldHighlightings> highlightings)
highlight
in interface IDocumentQueryCustomization
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.public DocumentQueryCustomizationFactory highlight(String fieldName, String fieldKeyName, int fragmentLength, int fragmentCount, Reference<FieldHighlightings> highlightings)
highlight
in interface IDocumentQueryCustomization
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.public DocumentQueryCustomizationFactory setHighlighterTags(String preTag, String postTag)
setHighlighterTags
in interface IDocumentQueryCustomization
preTag
- Prefix tag.postTag
- Postfix tag.public DocumentQueryCustomizationFactory setHighlighterTags(String[] preTags, String[] postTags)
setHighlighterTags
in interface IDocumentQueryCustomization
preTags
- Prefix tags.postTags
- Postfix tags.public DocumentQueryCustomizationFactory noTracking()
noTracking
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory noCaching()
noCaching
in interface IDocumentQueryCustomization
public void customize(IDocumentQueryCustomization documentQuery)
public static DocumentQueryCustomizationFactory join(DocumentQueryCustomizationFactory firstCustomize, DocumentQueryCustomizationFactory secondCustomize)
public DocumentQueryCustomizationFactory setAllowMultipleIndexEntriesForSameDocumentToResultTransformer(boolean val)
IDocumentQueryCustomization
setAllowMultipleIndexEntriesForSameDocumentToResultTransformer
in interface IDocumentQueryCustomization
public DocumentQueryCustomizationFactory showTimings()
IDocumentQueryCustomization
showTimings
in interface IDocumentQueryCustomization
Copyright © 2016. All Rights Reserved.