SMILA (incubation) API documentation

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

java.lang.Object
  extended by org.eclipse.smila.search.api.helper.ResultAccessor
Direct Known Subclasses:
ResultBuilder, SolrResultAccessor

public class ResultAccessor
extends java.lang.Object

Wrapper for a complete search result object. Basically provides method to create access helpers for the single query and result records contained in the search result. Can also create a new query builder based on the effective query object in the search result.

Author:
jschumacher

Field Summary
protected  Record _result
          the search result.
 
Constructor Summary
ResultAccessor(java.lang.String workflowName, Record result)
          create instance.
 
Method Summary
 long getCount()
          get number of hits.
 AnyMap getGroups()
          get groups (facets).
 long getIndexSize()
          get size of search index.
 int getNumberOfRecords()
           
 Any getQuery()
           
 Record getResult()
          access original result.
 ResultItemAccessor getResultRecord(int index)
          create a wrapper for the n'th result record.
 AnySeq getResultRecords()
           
 long getRuntime()
          get runtime duration of search.
 java.lang.String getWorkflowName()
           
 boolean hasQuery()
           
 boolean hasRecords()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_result

protected final Record _result
the search result.

Constructor Detail

ResultAccessor

public ResultAccessor(java.lang.String workflowName,
                      Record result)
create instance.

Parameters:
workflowName - name of workflow
result - the search result.
Method Detail

getResult

public Record getResult()
access original result.

Returns:
the search result.

getWorkflowName

public java.lang.String getWorkflowName()
Returns:
name of pipeline that produced the search result.

hasQuery

public boolean hasQuery()
Returns:
true if result contains a query part.

getQuery

public Any getQuery()
Returns:
effective query part of the result

getCount

public long getCount()
get number of hits.


getIndexSize

public long getIndexSize()
get size of search index.


getRuntime

public long getRuntime()
get runtime duration of search.


getGroups

public AnyMap getGroups()
get groups (facets).


hasRecords

public boolean hasRecords()
Returns:
true if the result contains a (possibly empty) records list. false, if no records list is present.

getResultRecords

public AnySeq getResultRecords()
Returns:
result records, if any exist. Else null.

getNumberOfRecords

public int getNumberOfRecords()
Returns:
number of result records.

getResultRecord

public ResultItemAccessor getResultRecord(int index)
create a wrapper for the n'th result record.

Parameters:
index - position in result list.
Returns:
wrapper for the result record, or null if index in invalid.

SMILA (incubation) API documentation