10 #ifndef _STRUS_WEIGHTED_DOCUMENT_HPP_INCLUDED
11 #define _STRUS_WEIGHTED_DOCUMENT_HPP_INCLUDED
26 :m_docno(0),m_weight(0.0){}
29 :m_docno(o.m_docno),m_weight(o.m_weight){}
32 :m_docno(docno_),m_weight(weight_){}
37 double weight()
const {
return m_weight;}
42 double diff = m_weight - o.m_weight;
43 if (fabs( diff) < std::numeric_limits<double>::epsilon())
45 return m_docno < o.m_docno;
55 double diff = m_weight - o.m_weight;
56 if (fabs( diff) < std::numeric_limits<double>::epsilon())
58 return m_docno > o.m_docno;
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
Numeric types used for local and global indices.
bool operator<(const WeightedDocument &o) const
Comparison for sorting.
Definition: weightedDocument.hpp:40
Pure ranking result of a strus query without the attributes.
Definition: weightedDocument.hpp:21
bool operator>(const WeightedDocument &o) const
Comparison for sorting.
Definition: weightedDocument.hpp:53
WeightedDocument()
Default constructor.
Definition: weightedDocument.hpp:25
WeightedDocument(const Index &docno_, double weight_)
Constructor.
Definition: weightedDocument.hpp:31
WeightedDocument(const WeightedDocument &o)
Copy constructor.
Definition: weightedDocument.hpp:28
Index docno() const
Get the document number of the result.
Definition: weightedDocument.hpp:35
double weight() const
Get the accumulated weight of the ranking of the result.
Definition: weightedDocument.hpp:37