Class SearchResultItemImpl<T>
java.lang.Object
org.opencastproject.elasticsearch.impl.SearchResultItemImpl<T>
- All Implemented Interfaces:
Comparable<SearchResultItem<T>>,SearchResultItem<T>
Default implementation of a
SearchResultItem.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSearchResultItemImpl(double relevance, T source) Creates a new search result item with the given uri. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(SearchResultItem<T> sr) booleandoubleReturns the relevance of this hit with respect to the search terms.Returns the search result's source.inthashCode()voidsetRelevance(double relevance) Sets the relevance value, representing the score in the search result.toString()
-
Field Details
-
source
Source of the search result -
score
protected double scoreScore within the search result
-
-
Constructor Details
-
SearchResultItemImpl
Creates a new search result item with the given uri. Thesourceis the object that created the item, usually, this will be the site itself but it could very well be a module that added to a search result.- Parameters:
relevance- the score inside the search resultsource- the object that produced the result item
-
-
Method Details
-
setRelevance
public void setRelevance(double relevance) Sets the relevance value, representing the score in the search result.- Parameters:
relevance- the relevance value
-
getRelevance
public double getRelevance()Description copied from interface:SearchResultItemReturns the relevance of this hit with respect to the search terms. Greater values mean increased relevance, a 1.0 signifies a direct hit while 0.0 means a very unlikely hit.- Specified by:
getRelevancein interfaceSearchResultItem<T>- Returns:
- the relevance
- See Also:
-
getSource
Returns the search result's source.- Specified by:
getSourcein interfaceSearchResultItem<T>- Returns:
- the source
- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<T>- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-