|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CompassQuery
An object representing a Compass query. The query is created using the
CompassQueryBuilder, and used to get the
matching CompassHits.
The query be sorted as well using one of the addSort
operations. Note that adding sorting is only applicable for the query that
will execute the hits() operation.
| Nested Class Summary | |
|---|---|
static interface |
CompassQuery.CompassSpanQuery
An extension to the CompassQuery interface. |
static class |
CompassQuery.SortDirection
Used to set the sort direction for the query. |
static class |
CompassQuery.SortImplicitType
Implicit types that the hits can be sorted by. |
static class |
CompassQuery.SortPropertyType
Used to define the type of the property that will be sorted. |
| Method Summary | |
|---|---|
CompassQuery |
addSort(CompassQuery.SortImplicitType implicitType)
Adds sorting on implicit types, which are not direct properties values. |
CompassQuery |
addSort(CompassQuery.SortImplicitType implicitType,
CompassQuery.SortDirection direction)
Adds sorting on implicit types, which are not direct properties values. |
CompassQuery |
addSort(String propertyName)
Adds sorting on the given property name. |
CompassQuery |
addSort(String propertyName,
CompassQuery.SortDirection direction)
Adds sorting on the given property name. |
CompassQuery |
addSort(String propertyName,
CompassQuery.SortPropertyType type)
Adds sorting on the given property name, and using the given property type. |
CompassQuery |
addSort(String propertyName,
CompassQuery.SortPropertyType type,
CompassQuery.SortDirection direction)
Adds sorting on the given property name, and using the given property type. |
CompassQuery |
addSort(String propertyName,
Locale locale)
Adds sorting on the given property name, and using the given locale. |
CompassQuery |
addSort(String propertyName,
Locale locale,
CompassQuery.SortDirection direction)
Adds sorting on the given property name, and using the given locale. |
Object |
clone()
Clones the given query. |
long |
count()
Returns the count of hits that match this query. |
long |
count(float minimumScore)
Returns the count of hits that match this query and are higher than the given score. |
CompassQueryFilter |
getFilter()
Returns the filter set using setFilter(CompassQueryFilter). |
CompassQuery |
getSuggestedQuery()
Returns the suggested query (based on spell check). |
CompassHits |
hits()
Performs the search and returns the hits that match the qeury. |
boolean |
isSuggested()
Returns true if this is a suggested query. |
CompassQuery |
rewrite()
Causes the query to be rewritten before executed to search. |
CompassQuery |
setAliases(String... aliases)
Narrows down the query to be executed only against the given aliases. |
CompassQuery |
setBoost(float boost)
Sets the boost for this query to boost. |
CompassQuery |
setFilter(CompassQueryFilter filter)
Sets a filter to the query. |
CompassQuery |
setSubIndexes(String... subIndexes)
Narrows down the query to be executed only against the given sub indexes. |
CompassQuery |
setTypes(Class... types)
Narrows down the query to be executed only against the given types. |
| Method Detail |
|---|
CompassQuery setBoost(float boost)
boost. Hits matching
this query will (in addition to the normal weightings) have their score
multiplied by boost.
CompassQuery addSort(String propertyName)
addSort(String,SortPropertyType).
Note that the property must be UN_TOKENIZED, and stored.
Note, that the sort option will only work on the outer most query (i.e.
the one that the hits is called on).
propertyName - The property name that will be sorted.
CompassQuery addSort(String propertyName,
CompassQuery.SortDirection direction)
addSort(String,SortPropertyType).
Note that the property must be UN_TOKENIZED, and stored.
Note, that the sort option will only work on the outer most query (i.e.
the one that the hits is called on).
propertyName - The property name that will be sorted.direction - The direction for the sorting.
CompassQuery addSort(String propertyName,
CompassQuery.SortPropertyType type)
INT has the lowest memorty requirements
and STRING the most.
Note that the property must be UN_TOKENIZED, and stored.
Note, that the sort option will only work on the outer most query (i.e.
the one that the hits is called on).
propertyName - The property name that will be sorted.type - The type of the propert.
CompassQuery addSort(String propertyName,
CompassQuery.SortPropertyType type,
CompassQuery.SortDirection direction)
INT has the lowest memorty requirements
and STRING the most.
Note that the property must be UN_TOKENIZED, and stored.
Note, that the sort option will only work on the outer most query (i.e.
the one that the hits is called on).
propertyName - The property name that will be sorted.type - The type of the propert.direction - The direction of the sorting.
CompassQuery addSort(CompassQuery.SortImplicitType implicitType)
Note, that the sort option will only work on the outer most query (i.e.
the one that the hits is called on).
implicitType - The implicit type to add sorting on.
CompassQuery addSort(CompassQuery.SortImplicitType implicitType,
CompassQuery.SortDirection direction)
Note, that the sort option will only work on the outer most query (i.e.
the one that the hits is called on).
implicitType - The implicit type to add sorting on.direction - The direction of the sorting.
CompassQuery addSort(String propertyName,
Locale locale,
CompassQuery.SortDirection direction)
hits is called on).
propertyName - The property name that will be sorted.locale - The locale.direction - The direction of the sorting.
CompassQuery addSort(String propertyName,
Locale locale)
propertyName - The property name that will be sorted.locale - The locale.
CompassQuery setSubIndexes(String... subIndexes)
null, will use all sub indexes.
subIndexes - sub indexes the query will be executed against
CompassQuery setAliases(String... aliases)
null, will use all aliases.
aliases - aliases the query will be executed against
CompassQuery setTypes(Class... types)
setAliases(String[]).
types - class types the query will be executed against
CompassQuery setFilter(CompassQueryFilter filter)
CompassQueryFilterBuilder.
filter - The filter for the query
CompassQueryFilter getFilter()
setFilter(CompassQueryFilter). null
if none is set.
setFilter(CompassQueryFilter)CompassQuery rewrite()
CompassQuery getSuggestedQuery()
In order to know if the query was actually replaced with a suggested one, call
isSuggested().
boolean isSuggested()
true if this is a suggested query. For example, when performing
a search query with spell check enabled, then it will return true if the
query was modified to correct some spelling mistakes.
CompassHits hits()
throws CompassException
CompassExceptionlong count()
CompassHitsOperations.length().
Same as calling count(0.0f).
long count(float minimumScore)
CompassHitsOperations.length().
Object clone()
throws CloneNotSupportedException
CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||