21 #ifndef DDC_QUERY_RESULT_H 22 #define DDC_QUERY_RESULT_H 78 template <
typename HitIndexLessThanT>
84 template <
typename HitLessThanT>
90 template <
typename HitIndexLessThanT>
97 template <
typename HitLessThanT>
116 : m_Result(Result), m_HitLess(HitLess)
120 inline bool operator() (
size_t i1,
size_t i2)
const 121 {
return m_HitLess(m_Result.
m_Hits[i1], m_Result.
m_Hits[i2]); }
142 : m_Result(Result), m_pHitIndex(NULL), m_bLocalIndex(false)
148 : m_Result(Result), m_pHitIndex(HitIndex), m_bLocalIndex(false)
154 : m_Result(Result), m_pHitIndex(&HitIndex), m_bLocalIndex(false)
159 {
if (m_bLocalIndex)
delete m_pHitIndex; };
166 {
return m_pHitIndex==NULL ? 0 : m_pHitIndex->size(); };
171 template <
typename HitIndexLessThanT>
173 { stable_sort(m_pHitIndex->begin(), m_pHitIndex->end(), HitIndexLess); };
178 template <
typename HitLessThanT>
182 SortByIndex(ResultLess);
189 void Apply(
CQueryResult &Dst,
size_t Begin=0,
size_t End=(
size_t)-1);
199 template <
typename HitIndexLessThanT>
204 ResultIndex.
Apply(*
this);
208 template <
typename HitLessThanT>
213 ResultIndex.
Apply(*
this);
size_t size(void) const
Wrapper for m_pHitIndex->size()
Definition: QueryResult.h:165
HitLessThanT & m_HitLess
hit comparison operator
Definition: QueryResult.h:112
A file for globally defined constants and classes.
HitSortOrderEnum
Definition: ConcCommon.h:172
CQueryResultIndex(const CQueryResult &Result)
Default constructor creates new trivial hit index.
Definition: QueryResult.h:141
void SortResultsByHit(HitLessThanT &HitLess)
Definition: QueryResult.h:209
bool m_bSortByString
whether to sort by string-value
Definition: QueryResult.h:61
~CQueryResultIndex(void)
Destructor.
Definition: QueryResult.h:158
CQueryResult: query results, possibly aggregated by "break".
Definition: QueryResult.h:43
void SortResultsByIndexP(HitIndexLessThanT HitIndexLess)
Definition: QueryResult.h:91
vector< CTokenNo > m_HighlightOccurs
words that should be highlighted in hits; m_HighlightOccurs is the concatenation of CQueryNode::m_Occ...
Definition: QueryResult.h:49
bool m_bPrune
whether primary sort is a prune-sort
Definition: QueryResult.h:64
CResultHitLess(const CQueryResult &Result, HitLessThanT &HitLess)
default constructor
Definition: QueryResult.h:115
void SortResultsByIndex(HitIndexLessThanT &HitIndexLess)
Definition: QueryResult.h:200
size_t m_AllHitsCount
the number of all found hits (if m_AllHitsCount < m_pConcordance->m_MaxCachedHitsCount, then m_Hits.size() == m_AllHitsCount)
Definition: QueryResult.h:55
vector< CHit > m_Hits
found hits (not more than m_pConcordance->m_MaxCachedHitsCount).
Definition: QueryResult.h:46
HitSortOrderEnum m_SortOrder
hit sort order
Definition: QueryResult.h:67
void SortByHit(HitLessThanT &HitLess)
Definition: QueryResult.h:179
CQueryResultIndex(const CQueryResult &Result, vector< size_t > *HitIndex)
Definition: QueryResult.h:147
size_t m_RelevantDocumentCount
the number of documents, where at least one hit is found
Definition: QueryResult.h:58
void SortByIndex(HitIndexLessThanT &HitIndexLess)
Definition: QueryResult.h:172
vector< BYTE > m_HighlightIds
highlighting match-ids for m_HighlightOccurs
Definition: QueryResult.h:52
vector< BYTE > m_DebugInfo
?
Definition: QueryResult.h:70
map< string, size_t > CCountMap
type for count-query maps
Definition: QueryResult.h:30
void ClearQueryResults()
clears CQueryResult fields
Definition: QueryResult.cpp:27
const CQueryResult & m_Result
result-set containing hits to be indexed/sorted
Definition: QueryResult.h:132
CQueryResultIndex(const CQueryResult &Result, vector< size_t > &HitIndex)
Definition: QueryResult.h:153
template for converting hit-comparison functions to index-comparisons for CQueryResult sorting ...
Definition: QueryResult.h:106
vector< size_t > * m_pHitIndex
hit index: elements are indices into m_Result.m_Hits, sorted in "logical" order
Definition: QueryResult.h:135
temporary type for (re-)sorting CQueryResult hits
Definition: QueryResult.h:129
void SortResultsByHitP(HitLessThanT HitLess)
Definition: QueryResult.h:98
bool m_bLocalIndex
whether m_pHitIndex was created locally (if true, it will be destroyed with this object) ...
Definition: QueryResult.h:138
const CQueryResult & m_Result
result hit-set with respect to which comparisons will be executed
Definition: QueryResult.h:109
void Apply(CQueryResult &Dst, size_t Begin=0, size_t End=(size_t) -1)
Definition: QueryResult.cpp:57