org.eclipse.smila.search.api.helper
Class ResultBuilder
java.lang.Object
org.eclipse.smila.search.api.helper.ResultAccessor
org.eclipse.smila.search.api.helper.ResultBuilder
public class ResultBuilder
- extends ResultAccessor
wrapper helper class to build the result record. This is intentionally a subclass of the ResultAccessor as to
also provide readaccess to the props that are set here.
| Methods inherited from class org.eclipse.smila.search.api.helper.ResultAccessor |
getCount, getGroups, getIndexSize, getNumberOfRecords, getQuery, getResult, getResultRecord, getResultRecords, getRuntime, getWorkflowName, hasQuery, hasRecords |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResultBuilder
public ResultBuilder(java.lang.String workflowName,
Record result)
- Creates a new builder and adds an AnySeq for the
SearchResultConstants.RECORDS.
- Parameters:
workflowName - result -
addResultItem
public AnyMap addResultItem(java.lang.String id,
java.lang.Double score)
- Adds a new result item to the list. the given args are mandatory and will be set at the item.
- Returns:
- the map containing the id and score/weight under their proper names.
setCount
public void setCount(java.lang.Long count)
- sets value for
SearchResultConstants.COUNT.
setRuntime
public void setRuntime(java.lang.Long millis)
- sets value for
SearchResultConstants.RUNTIME.