org.gcube.search.datafusion.datatypes
Class RankedRecord
java.lang.Object
org.gcube.search.datafusion.datatypes.RankedRecord
- All Implemented Interfaces:
- Serializable, Comparable<RankedRecord>
public class RankedRecord
- extends Object
- implements Comparable<RankedRecord>, Serializable
- Author:
- Alex Antoniadis
- See Also:
- Serialized Form
RankedRecord
public RankedRecord(String id,
Long position,
Float rank,
Integer luceneDocID,
Boolean includePosition)
RankedRecord
public RankedRecord(String id,
Long position,
Float rank,
Integer luceneDocID)
toString
public String toString()
- Overrides:
toString in class Object
getLuceneDocID
public Integer getLuceneDocID()
compareTo
public int compareTo(RankedRecord r)
- Specified by:
compareTo in interface Comparable<RankedRecord>
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
calcScore
public static Float calcScore(RankedRecord r)
- Calculates the score of the record. If includePosition is true then
the total score is the sum of the rank and the score that is calculated in
RankedRecord#posScore, else
rank is returned.
- Parameters:
r -
- Returns:
- score of record
recalculateScores
public static List<RankedRecord> recalculateScores(Map<String,Long> recPositions,
Map<String,Pair> recScores,
Boolean includePosition)
- Recalculates the score of the records that are retrieved after querying the lucene index in order to
perform some other refinements. Currently, if includePosition is true the score of the results is recalculated
from their initial position.
- Parameters:
recPositions - recScores - includePosition -
- Returns:
- resorted list of
RankedRecords
Copyright © 2013. All Rights Reserved.