public class HSQueryImpl extends Object implements HSQuery, Serializable
DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, SPATIAL_DISTANCE, THIS| Constructor and Description |
|---|
HSQueryImpl(ExtendedSearchIntegrator extendedIntegrator) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterDeserialise(SearchIntegrator extendedIntegrator)
afterDeserialise.
|
void |
disableFullTextFilter(String name)
Disable a given filter by its name.
|
FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name.
|
Explanation |
explain(int documentId)
Return the Lucene
Explanation
object describing the score computation for the matching object/document
in the current query |
HSQuery |
filter(Filter filter)
Allows to use lucene filters.
|
HSQuery |
firstResult(int firstResult)
Set the first element to retrieve.
|
ExtendedSearchIntegrator |
getExtendedSearchIntegrator()
getExtendedSearchIntegrator.
|
FacetManagerImpl |
getFacetManager() |
Set<Class<?>> |
getIndexedTargetedEntities()
Set of indexed entities corresponding to the class hierarchy of the targeted entities
|
Query |
getLuceneQuery() |
String[] |
getProjectedFields() |
List<Class<?>> |
getTargetedEntities()
List of targeted entities as described by the user
|
TimeoutManager |
getTimeoutManager() |
HSQuery |
luceneQuery(Query query)
Defines the underlying Lucene query
|
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).
|
DocumentExtractor |
queryDocumentExtractor()
DocumentExtractor returns a traverser over the full-text results (EntityInfo)
This operation is lazy bound:
- the query is executed
- results are not retrieved until actually requested
DocumentExtractor objects *must* be closed when the results are no longer traversed.
|
List<EntityInfo> |
queryEntityInfos()
Execute the Lucene query and return the list of
EntityInfos populated with
metadata and projection. |
int |
queryResultSize() |
HSQuery |
setSpatialParameters(Coordinates center,
String fieldName)
setSpatialParameters.
|
HSQuery |
sort(Sort sort)
Lets Lucene sort the results.
|
HSQuery |
targetedEntities(List<Class<?>> classes)
Defines the targeted entities.
|
HSQuery |
timeoutExceptionFactory(TimeoutExceptionFactory exceptionFactory)
Define the timeout exception factory to customize the exception returned by the user.
|
public HSQueryImpl(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 luceneQuery(Query query)
HSQueryluceneQuery in interface HSQueryquery - the Lucene querythis to allow method chainingpublic 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(Sort sort)
HSQuerypublic HSQuery filter(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)
HSQueryTwoWayFieldBridge
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 List<Class<?>> getTargetedEntities()
getTargetedEntities in interface HSQuerypublic Set<Class<?>> getIndexedTargetedEntities()
getIndexedTargetedEntities in interface HSQuerypublic String[] getProjectedFields()
getProjectedFields in interface HSQuerypublic TimeoutManager getTimeoutManager()
getTimeoutManager in interface HSQuerytimeoutManager.start() and timeoutManager.stop().public FacetManagerImpl getFacetManager()
getFacetManager in interface HSQuerypublic Query getLuceneQuery()
getLuceneQuery in interface HSQuerypublic List<EntityInfo> queryEntityInfos()
HSQueryEntityInfos populated with
metadata and projection. ProjectionConstants.THIS if projected is queryEntityInfos in interface HSQueryEntityInfos populated with metadata and projectionpublic DocumentExtractor queryDocumentExtractor()
queryDocumentExtractor in interface HSQueryDocumentExtractor instancepublic int queryResultSize()
queryResultSize in interface HSQuerypublic Explanation explain(int documentId)
HSQueryExplanation
object describing the score computation for the matching object/document
in the current querypublic 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 ExtendedSearchIntegrator getExtendedSearchIntegrator()
HSQuerygetExtendedSearchIntegrator.
getExtendedSearchIntegrator in interface HSQueryExtendedSearchintegrator instanceCopyright © 2006-2015 Red Hat, Inc. All Rights Reserved