Class SearchResultImpl<T>
java.lang.Object
org.opencastproject.elasticsearch.impl.SearchResultImpl<T>
- All Implemented Interfaces:
org.opencastproject.elasticsearch.api.SearchResult<T>
public class SearchResultImpl<T>
extends Object
implements org.opencastproject.elasticsearch.api.SearchResult<T>
Base implementation for a search result.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longThe total size of the search result setprotected longThe total number of appearances of the search criteriaprotected longThe search limitprotected longThe search offsetprotected org.opencastproject.elasticsearch.api.SearchQueryThe query that led to this search resultThe search resultprotected longThe time it took to do the search in ms -
Constructor Summary
ConstructorsConstructorDescriptionSearchResultImpl(org.opencastproject.elasticsearch.api.SearchQuery query, long hitCount, long documentCount) Creates a search result that was created using the given query. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResultItem(org.opencastproject.elasticsearch.api.SearchResultItem<T> item) Adds the given search result item to the result set.longlongorg.opencastproject.elasticsearch.api.SearchResultItem<T>[]getItems()longgetLimit()longlonggetPage()longorg.opencastproject.elasticsearch.api.SearchQuerygetQuery()longvoidsetDocumentCount(long count) Sets the document count.voidsetSearchTime(long time) Sets the search time in milliseconds.
-
Field Details
-
query
protected org.opencastproject.elasticsearch.api.SearchQuery queryThe query that led to this search result -
offset
protected long offsetThe search offset -
limit
protected long limitThe search limit -
hitCount
protected long hitCountThe total number of appearances of the search criteria -
documentCount
protected long documentCountThe total size of the search result set -
time
protected long timeThe time it took to do the search in ms -
result
The search result
-
-
Constructor Details
-
SearchResultImpl
public SearchResultImpl(org.opencastproject.elasticsearch.api.SearchQuery query, long hitCount, long documentCount) Creates a search result that was created using the given query. Note thathitsindicates the overall number of appearances of the search term, while size is equal to the number of documents that contain thosehitshits.- Parameters:
query- the queryhitCount- the number of hitsdocumentCount- the total size of the result set
-
-
Method Details
-
addResultItem
Adds the given search result item to the result set.- Parameters:
item- the result item
-
getItems
- Specified by:
getItemsin interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
getLimit
public long getLimit()- Specified by:
getLimitin interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
getOffset
public long getOffset()- Specified by:
getOffsetin interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
getPage
public long getPage()- Specified by:
getPagein interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
getPageSize
public long getPageSize()- Specified by:
getPageSizein interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
getQuery
public org.opencastproject.elasticsearch.api.SearchQuery getQuery() -
setSearchTime
public void setSearchTime(long time) Sets the search time in milliseconds.- Parameters:
time- the time
-
getSearchTime
public long getSearchTime()- Specified by:
getSearchTimein interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
getHitCount
public long getHitCount()- Specified by:
getHitCountin interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
getDocumentCount
public long getDocumentCount()- Specified by:
getDocumentCountin interfaceorg.opencastproject.elasticsearch.api.SearchResult<T>- See Also:
-
setDocumentCount
public void setDocumentCount(long count) Sets the document count.- Parameters:
count- the number of documents in this search result
-