public abstract class AbstractHSQuery extends Object implements HSQuery, Serializable
HSQuery implementations, exposing basic state needed by all implementations.| Modifier and Type | Field and Description |
|---|---|
protected ExtendedSearchIntegrator |
extendedIntegrator |
protected Map<String,FullTextFilterImpl> |
filterDefinitions
The map of currently active/enabled filters.
|
protected int |
firstResult |
protected Set<Class<?>> |
indexedTargetedEntities |
protected Integer |
maxResults |
protected String[] |
projectedFields |
protected org.apache.lucene.search.Sort |
sort |
protected String |
spatialFieldName |
protected Coordinates |
spatialSearchCenter |
protected List<Class<?>> |
targetedEntities |
protected String |
tenantId |
protected TimeoutExceptionFactory |
timeoutExceptionFactory |
protected TimeoutManagerImpl |
timeoutManager |
protected org.apache.lucene.search.Filter |
userFilter
User specified filters.
|
DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, SPATIAL_DISTANCE, THIS| Constructor and Description |
|---|
AbstractHSQuery(ExtendedSearchIntegrator extendedIntegrator) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterDeserialise(SearchIntegrator extendedIntegrator)
afterDeserialise.
|
protected abstract TimeoutManagerImpl |
buildTimeoutManager() |
protected abstract void |
clearCachedResults() |
void |
disableFullTextFilter(String name)
Disable a given filter by its name.
|
FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name.
|
HSQuery |
filter(org.apache.lucene.search.Filter filter)
Allows to use lucene filters.
|
HSQuery |
firstResult(int firstResult)
Set the first element to retrieve.
|
ExtendedSearchIntegrator |
getExtendedSearchIntegrator()
getExtendedSearchIntegrator.
|
Set<Class<?>> |
getIndexedTargetedEntities()
Set of indexed entities corresponding to the class hierarchy of the targeted entities
|
String[] |
getProjectedFields() |
List<Class<?>> |
getTargetedEntities()
List of targeted entities as described by the user
|
TimeoutManagerImpl |
getTimeoutManager() |
HSQuery |
maxResults(int maxResults)
Set the maximum number of elements to retrieve.
|
HSQuery |
projection(String... fields)
Defines the Lucene field names projected and returned in a query result
Each field is converted back to it's object representation, an Object[] being returned for each "row"
(similar to an HQL or a Criteria API projection).
|
HSQuery |
setSpatialParameters(Coordinates center,
String fieldName)
setSpatialParameters.
|
HSQuery |
sort(org.apache.lucene.search.Sort sort)
Lets Lucene sort the results.
|
HSQuery |
targetedEntities(List<Class<?>> classes)
Defines the targeted entities.
|
HSQuery |
tenantIdentifier(String tenantId) |
HSQuery |
timeoutExceptionFactory(TimeoutExceptionFactory exceptionFactory)
Define the timeout exception factory to customize the exception returned by the user.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexplain, getFacetManager, getLuceneQuery, luceneQuery, queryDocumentExtractor, queryEntityInfos, queryResultSizeprotected transient ExtendedSearchIntegrator extendedIntegrator
protected transient TimeoutExceptionFactory timeoutExceptionFactory
protected transient TimeoutManagerImpl timeoutManager
protected org.apache.lucene.search.Sort sort
protected String tenantId
protected String[] projectedFields
protected int firstResult
protected Integer maxResults
protected Coordinates spatialSearchCenter
protected String spatialFieldName
protected org.apache.lucene.search.Filter userFilter
filter(org.apache.lucene.search.Filter).protected final Map<String,FullTextFilterImpl> filterDefinitions
public AbstractHSQuery(ExtendedSearchIntegrator extendedIntegrator)
public void afterDeserialise(SearchIntegrator extendedIntegrator)
HSQueryafterDeserialise.
afterDeserialise in interface HSQueryextendedIntegrator - a SearchIntegrator object.public HSQuery setSpatialParameters(Coordinates center, String fieldName)
HSQuerysetSpatialParameters.
setSpatialParameters in interface HSQuerycenter - center of the spatial searchfieldName - name ot the spatial fieldthis to allow for method chainingpublic HSQuery tenantIdentifier(String tenantId)
tenantIdentifier in interface HSQuerypublic HSQuery targetedEntities(List<Class<?>> classes)
HSQuerytargetedEntities in interface HSQueryclasses - the list of classes (indexes) targeted by this querythis to allow for method chainingpublic HSQuery sort(org.apache.lucene.search.Sort sort)
HSQuerypublic HSQuery filter(org.apache.lucene.search.Filter filter)
HSQuerypublic HSQuery timeoutExceptionFactory(TimeoutExceptionFactory exceptionFactory)
HSQueryQueryTimeoutExceptiontimeoutExceptionFactory in interface HSQueryexceptionFactory - the timeout exception factory to usethis to allow for method chainingpublic HSQuery projection(String... fields)
HSQuery
A projectable field must be stored in the Lucene index and use a TwoWayFieldBridge
Unless notified in their JavaDoc, all built-in bridges are two-way. All @DocumentId fields are projectable by design.
If the projected field is not a projectable field, null is returned in the object[]
projection in interface HSQueryfields - the projected field namesthis to allow for method chainingpublic HSQuery firstResult(int firstResult)
HSQueryfirstResult in interface HSQueryfirstResult - a element number, numbered from 0this to allow for method chainingpublic HSQuery maxResults(int maxResults)
HSQuerymaxResults in interface HSQuerymaxResults - the maximum number of elementsthis in order to allow method chainingpublic FullTextFilter enableFullTextFilter(String name)
HSQueryenableFullTextFilter in interface HSQueryname - the name of the filter to enableFullTextFilter object that allows filter parameter injectionpublic void disableFullTextFilter(String name)
HSQuerydisableFullTextFilter in interface HSQueryname - the name of the filter to disable.public List<Class<?>> getTargetedEntities()
getTargetedEntities in interface HSQuerypublic Set<Class<?>> getIndexedTargetedEntities()
getIndexedTargetedEntities in interface HSQuerypublic String[] getProjectedFields()
getProjectedFields in interface HSQuerypublic TimeoutManagerImpl getTimeoutManager()
getTimeoutManager in interface HSQuerytimeoutManager.start() and timeoutManager.stop().public ExtendedSearchIntegrator getExtendedSearchIntegrator()
HSQuerygetExtendedSearchIntegrator.
getExtendedSearchIntegrator in interface HSQueryExtendedSearchintegrator instanceprotected abstract void clearCachedResults()
protected abstract TimeoutManagerImpl buildTimeoutManager()
Copyright © 2006–2016 Hibernate. All rights reserved.