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

    Fields
    Modifier and Type
    Field
    Description
    protected long
    The total size of the search result set
    protected long
    The total number of appearances of the search criteria
    protected long
    The search limit
    protected long
    The search offset
    protected org.opencastproject.elasticsearch.api.SearchQuery
    The query that led to this search result
    protected List<org.opencastproject.elasticsearch.api.SearchResultItem<T>>
    The search result
    protected long
    The time it took to do the search in ms
  • Constructor Summary

    Constructors
    Constructor
    Description
    SearchResultImpl(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 Type
    Method
    Description
    void
    addResultItem(org.opencastproject.elasticsearch.api.SearchResultItem<T> item)
    Adds the given search result item to the result set.
    long
    long
    org.opencastproject.elasticsearch.api.SearchResultItem<T>[]
    long
    long
    long
    long
    org.opencastproject.elasticsearch.api.SearchQuery
    long
    void
    setDocumentCount(long count)
    Sets the document count.
    void
    setSearchTime(long time)
    Sets the search time in milliseconds.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • query

      protected org.opencastproject.elasticsearch.api.SearchQuery query
      The query that led to this search result
    • offset

      protected long offset
      The search offset
    • limit

      protected long limit
      The search limit
    • hitCount

      protected long hitCount
      The total number of appearances of the search criteria
    • documentCount

      protected long documentCount
      The total size of the search result set
    • time

      protected long time
      The time it took to do the search in ms
    • result

      protected List<org.opencastproject.elasticsearch.api.SearchResultItem<T>> 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 that hits indicates the overall number of appearances of the search term, while size is equal to the number of documents that contain those hits hits.
      Parameters:
      query - the query
      hitCount - the number of hits
      documentCount - the total size of the result set
  • Method Details

    • addResultItem

      public void addResultItem(org.opencastproject.elasticsearch.api.SearchResultItem<T> item)
      Adds the given search result item to the result set.
      Parameters:
      item - the result item
    • getItems

      public org.opencastproject.elasticsearch.api.SearchResultItem<T>[] getItems()
      Specified by:
      getItems in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getItems()
    • getLimit

      public long getLimit()
      Specified by:
      getLimit in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getLimit()
    • getOffset

      public long getOffset()
      Specified by:
      getOffset in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getOffset()
    • getPage

      public long getPage()
      Specified by:
      getPage in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getPage()
    • getPageSize

      public long getPageSize()
      Specified by:
      getPageSize in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getPageSize()
    • 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:
      getSearchTime in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getSearchTime()
    • getHitCount

      public long getHitCount()
      Specified by:
      getHitCount in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getHitCount()
    • getDocumentCount

      public long getDocumentCount()
      Specified by:
      getDocumentCount in interface org.opencastproject.elasticsearch.api.SearchResult<T>
      See Also:
      • SearchResult.getDocumentCount()
    • setDocumentCount

      public void setDocumentCount(long count)
      Sets the document count.
      Parameters:
      count - the number of documents in this search result