|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.search.query.engine.impl.HSQueryImpl
public class HSQueryImpl
| Field Summary |
|---|
| Fields inherited from interface org.hibernate.search.ProjectionConstants |
|---|
DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, SPATIAL_DISTANCE, THIS |
| Constructor Summary | |
|---|---|
HSQueryImpl(SearchFactoryImplementor searchFactoryImplementor)
|
|
| Method Summary | |
|---|---|
void |
afterDeserialise(SearchFactoryImplementor searchFactoryImplementor)
afterDeserialise. |
void |
disableFullTextFilter(String name)
Disable a given filter by its name. |
FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name. |
org.apache.lucene.search.Explanation |
explain(int documentId)
Return the Lucene Explanation
object describing the score computation for the matching object/document
in the current query |
HSQuery |
filter(org.apache.lucene.search.Filter filter)
Allows to use lucene filters. |
HSQuery |
firstResult(int firstResult)
Set the first element to retrieve. |
FacetManagerImpl |
getFacetManager()
|
Set<Class<?>> |
getIndexedTargetedEntities()
Set of indexed entities corresponding to the class hierarchy of the targeted entities |
org.apache.lucene.search.Query |
getLuceneQuery()
|
String[] |
getProjectedFields()
|
SearchFactoryImplementor |
getSearchFactoryImplementor()
getSearchFactoryImplementor. |
List<Class<?>> |
getTargetedEntities()
List of targeted entities as described by the user |
TimeoutManager |
getTimeoutManager()
|
HSQuery |
luceneQuery(org.apache.lucene.search.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(Point 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 |
timeoutExceptionFactory(TimeoutExceptionFactory exceptionFactory)
Define the timeout exception factory to customize the exception returned by the user. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HSQueryImpl(SearchFactoryImplementor searchFactoryImplementor)
| Method Detail |
|---|
public void afterDeserialise(SearchFactoryImplementor searchFactoryImplementor)
HSQueryafterDeserialise.
afterDeserialise in interface HSQuerysearchFactoryImplementor - a SearchFactoryImplementor object.
public HSQuery setSpatialParameters(Point center,
String fieldName)
HSQuerysetSpatialParameters.
setSpatialParameters in interface HSQuerycenter - center of the spatial searchfieldName - name ot the spatial field
this to allow for method chainingpublic HSQuery luceneQuery(org.apache.lucene.search.Query query)
HSQuery
luceneQuery in interface HSQueryquery - the Lucene query
this to allow method chainingpublic HSQuery targetedEntities(List<Class<?>> classes)
HSQuery
targetedEntities in interface HSQueryclasses - the list of classes (indexes) targeted by this query
this to allow for method chainingpublic HSQuery sort(org.apache.lucene.search.Sort sort)
HSQuery
sort in interface HSQuerysort - The Lucene sort object.
this to allow for method chainingpublic HSQuery filter(org.apache.lucene.search.Filter filter)
HSQuery
filter in interface HSQueryfilter - The Lucene filter.
this to allow for method chainingpublic HSQuery timeoutExceptionFactory(TimeoutExceptionFactory exceptionFactory)
HSQueryQueryTimeoutException
timeoutExceptionFactory in interface HSQueryexceptionFactory - the timeout exception factory to use
this 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 names
this to allow for method chainingpublic HSQuery firstResult(int firstResult)
HSQuery
firstResult in interface HSQueryfirstResult - a element number, numbered from 0
this to allow for method chainingpublic HSQuery maxResults(int maxResults)
HSQuery
maxResults in interface HSQuerymaxResults - the maximum number of elements
this 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 org.apache.lucene.search.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 org.apache.lucene.search.Explanation explain(int documentId)
HSQueryExplanation
object describing the score computation for the matching object/document
in the current query
explain in interface HSQuerydocumentId - Lucene Document id to be explain. This is NOT the object id
public FullTextFilter enableFullTextFilter(String name)
HSQuery
enableFullTextFilter in interface HSQueryname - the name of the filter to enable
FullTextFilter object that allows filter parameter injectionpublic void disableFullTextFilter(String name)
HSQuery
disableFullTextFilter in interface HSQueryname - the name of the filter to disable.public SearchFactoryImplementor getSearchFactoryImplementor()
HSQuerygetSearchFactoryImplementor.
getSearchFactoryImplementor in interface HSQuerySearchFactoryImplementor instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||