public class QueryServiceImpl extends Object implements QueryService
Constructor and Description |
---|
QueryServiceImpl() |
Modifier and Type | Method and Description |
---|---|
Map<String,Long> |
getAggregate(String itemType,
String property)
Retrieves the number of items with the specified type as defined by the Item subclass public field
ITEM_TYPE and aggregated by possible values of the specified
property. |
Map<String,Long> |
getAggregate(String itemType,
String property,
AggregateQuery query)
Deprecated.
As of version 1.3.0-incubating, use
getAggregateWithOptimizedQuery(String, String, AggregateQuery) instead |
Map<String,Long> |
getAggregateWithOptimizedQuery(String itemType,
String property,
AggregateQuery query)
Retrieves the number of items with the specified type as defined by the Item subclass public field
ITEM_TYPE and aggregated by possible values of the specified
property or, if the specified query is not null , perform that aggregate query. |
Map<String,Double> |
getMetric(String type,
String property,
String slashConcatenatedMetrics,
Condition condition)
Retrieves the specified metrics for the specified field of items of the specified type as defined by the Item subclass public field
ITEM_TYPE and matching the
specified Condition . |
long |
getQueryCount(String itemType,
Condition condition)
Retrieves the number of items of the specified type as defined by the Item subclass public field
ITEM_TYPE and matching the specified Condition . |
void |
postConstruct() |
void |
preDestroy() |
void |
setDefinitionsService(DefinitionsService definitionsService) |
void |
setPersistenceService(PersistenceService persistenceService) |
public void setPersistenceService(PersistenceService persistenceService)
public void setDefinitionsService(DefinitionsService definitionsService)
public void postConstruct()
public void preDestroy()
public Map<String,Long> getAggregate(String itemType, String property)
QueryService
ITEM_TYPE
and aggregated by possible values of the specified
property.getAggregate
in interface QueryService
itemType
- the String representation of the item type we want to retrieve the count of, as defined by its class' ITEM_TYPE
fieldproperty
- the property we're aggregating on, i.e. for each possible value of this property, we are counting how many items of the specified type have that valueItem for a discussion of {@code ITEM_TYPE}
@Deprecated public Map<String,Long> getAggregate(String itemType, String property, AggregateQuery query)
getAggregateWithOptimizedQuery(String, String, AggregateQuery)
insteadQueryService
QueryService.getAggregate(String, String)
if query is null but completely differently if it isn't
Retrieves the number of items with the specified type as defined by the Item subclass public field ITEM_TYPE
and aggregated by possible values of the specified
property or, if the specified query is not null
, perform that aggregate query.
Also return the global count of document matching the ITEM_TYPE
getAggregate
in interface QueryService
itemType
- the String representation of the item type we want to retrieve the count of, as defined by its class' ITEM_TYPE
fieldproperty
- the property we're aggregating on, i.e. for each possible value of this property, we are counting how many items of the specified type have that valuequery
- the AggregateQuery
specifying the aggregation that should be perfomedItem for a discussion of {@code ITEM_TYPE}
public Map<String,Long> getAggregateWithOptimizedQuery(String itemType, String property, AggregateQuery query)
QueryService
ITEM_TYPE
and aggregated by possible values of the specified
property or, if the specified query is not null
, perform that aggregate query.
This aggregate won't return the global count and should therefore be much faster than QueryService.getAggregate(String, String, AggregateQuery)
getAggregateWithOptimizedQuery
in interface QueryService
itemType
- the String representation of the item type we want to retrieve the count of, as defined by its class' ITEM_TYPE
fieldproperty
- the property we're aggregating on, i.e. for each possible value of this property, we are counting how many items of the specified type have that valuequery
- the AggregateQuery
specifying the aggregation that should be perfomedItem for a discussion of {@code ITEM_TYPE}
public Map<String,Double> getMetric(String type, String property, String slashConcatenatedMetrics, Condition condition)
QueryService
ITEM_TYPE
and matching the
specified Condition
.getMetric
in interface QueryService
type
- the String representation of the item type we want to retrieve the count of, as defined by its class' ITEM_TYPE
fieldproperty
- the name of the field for which the metrics should be computedslashConcatenatedMetrics
- a String specifying which metrics should be computed, separated by a slash (/
) (possible values: sum
for the sum of the
values, avg
for the average of the values, min
for the minimum value and max
for the maximum value)condition
- the condition the items must satisfyItem for a discussion of {@code ITEM_TYPE}
public long getQueryCount(String itemType, Condition condition)
QueryService
ITEM_TYPE
and matching the specified Condition
.getQueryCount
in interface QueryService
itemType
- the String representation of the item type we want to retrieve the count of, as defined by its class' ITEM_TYPE
fieldcondition
- the condition the items must satisfyItem for a discussion of {@code ITEM_TYPE}
Copyright © 2014–2023 Apache Software Foundation. All rights reserved.