SMILA (incubation) API documentation

org.eclipse.smila.search.api.helper
Class QueryRecordAccessor

java.lang.Object
  extended by org.eclipse.smila.search.api.helper.RecordAccessor
      extended by org.eclipse.smila.search.api.helper.QueryRecordAccessor

public class QueryRecordAccessor
extends RecordAccessor

accessor for query records in search results to read out additional result properties that are attached to the effective query object: term lists for query attributes, facets (aka categorization, grouping, questions), total number of search results, etc.

Author:
jschumacher

Constructor Summary
QueryRecordAccessor(Record record)
          create instance for record.
 
Method Summary
 java.lang.Double getBoostFactor(java.lang.String attributeName)
          get boost factor for attribute.
 Facets getFacets(java.lang.String attributeName)
          get facets list for an attribute.
 java.lang.String getIndexName()
           
 java.lang.Integer getIndexSize()
          get total number of objects evaluated in this search.
 java.lang.String getLanguage()
           
 java.util.Iterator<java.lang.String> getOrderByAttributeNames()
          get iterator on names of attributes that have an order-by parameter set.
 SearchParameters.OrderMode getOrderMode(java.lang.String attributeName)
          get order mode for an attribute.
 java.lang.String getParameter(java.lang.String name)
          gets a single valued parameter.
 java.util.List<java.lang.String> getParameters(java.lang.String name)
          gets a multi values parameter.
 java.lang.String getQuery()
           
 Annotation getRankingAnnotation(java.lang.String attributeName)
          return ranking annotation for current record or given attribute.
 java.lang.String getRankingName(java.lang.String attributeName)
          get ranking name for attribute or record.
 java.lang.Integer getResultOffset()
           
 java.lang.Integer getResultSize()
           
 java.lang.Integer getSearchRuntime()
          get runtime of search workflow in milliseconds.
 java.lang.Double getThreshold()
           
 java.lang.Integer getTotalHits()
          get total number of hits for the search result.
 
Methods inherited from class org.eclipse.smila.search.api.helper.RecordAccessor
annotationSize, annotationSize, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotationValue, getAnnotationValues, getLiteral, getLiterals, getRecord, getResultAnnotationFloatValue, getResultAnnotationIntValue, getResultAnnotationValue, getTerms, hasAnnotation, hasAnnotation, hasAttribute, hasLiterals, literalSize, unmodifiableList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryRecordAccessor

public QueryRecordAccessor(Record record)
create instance for record.

Parameters:
record - a query record.
Method Detail

getQuery

public java.lang.String getQuery()
Returns:
textual query string.

getResultSize

public java.lang.Integer getResultSize()
Returns:
value of result size parameter used in query.

getResultOffset

public java.lang.Integer getResultOffset()
Returns:
value of result offset parameter used in query.

getThreshold

public java.lang.Double getThreshold()
Returns:
value of threshod parameter used in query.

getLanguage

public java.lang.String getLanguage()
Returns:
value of language parameter used in query.

getIndexName

public java.lang.String getIndexName()
Returns:
value of index used in query

getTotalHits

public java.lang.Integer getTotalHits()
get total number of hits for the search result. This is the number of all objects in the index that are at least as relevant to the query as the threshold specifies and which match all filter attached to relevant query attributes.

Returns:
total number of hits.

getIndexSize

public java.lang.Integer getIndexSize()
get total number of objects evaluated in this search. This is usually the size of the used index, hence the name. Searches spanning multiple indexes could aggregate the various index sizes.

Returns:
nomber of evaluated objects.

getSearchRuntime

public java.lang.Integer getSearchRuntime()
get runtime of search workflow in milliseconds.

Returns:
runtime of workflow.

getParameter

public java.lang.String getParameter(java.lang.String name)
gets a single valued parameter.

Parameters:
name - parameter name
Returns:
current value or null.

getParameters

public java.util.List<java.lang.String> getParameters(java.lang.String name)
gets a multi values parameter.

Parameters:
name - parameter name
Returns:
current values of parameter or an empty list.

getFacets

public Facets getFacets(java.lang.String attributeName)
get facets list for an attribute.

Parameters:
attributeName - name of attribute.
Returns:
list of facets.

getOrderByAttributeNames

public java.util.Iterator<java.lang.String> getOrderByAttributeNames()
get iterator on names of attributes that have an order-by parameter set. Order of iteration is order of precedence in ordering.

Returns:
names of attributes to be ordered.

getOrderMode

public SearchParameters.OrderMode getOrderMode(java.lang.String attributeName)
get order mode for an attribute.

Parameters:
attributeName - attribute name
Returns:
mode for attribute, if specified, or null else.

getRankingAnnotation

public Annotation getRankingAnnotation(java.lang.String attributeName)
return ranking annotation for current record or given attribute.

Parameters:
attributeName - name of attribute, or null for top-level ranking annotation.
Returns:
ranking annotation, null if none exists.

getBoostFactor

public java.lang.Double getBoostFactor(java.lang.String attributeName)
get boost factor for attribute.

Parameters:
attributeName - attribute name
Returns:
boost factor if set, else null.

getRankingName

public java.lang.String getRankingName(java.lang.String attributeName)
get ranking name for attribute or record.

Parameters:
attributeName - attribute name, null for record
Returns:
record if set, else null.

SMILA (incubation) API documentation