ddc
|
count query More...
#include <QCount.h>
Public Member Functions | |
CQCount (CQuery *dtr_=NULL, CQCountKeyExprList *keys_=NULL, size_t sample_=DDCDefaultCountSampleSize, HitSortEnum sort_=NoSort, string lb="", string ub="") | |
bison constructor More... | |
virtual | ~CQCount (void) |
Default destructor. More... | |
virtual BYTE | GetMatchId () const |
get local match-id: keys > dtr More... | |
bool | CompileLocal (CQueryCompiler *compiler, bool compileDtr=true, bool compileKeys=true) |
Compile index-dependent query properties. More... | |
virtual bool | CheckSatisfiable (CQueryCompiler *compiler) |
Run optional unsatisfiability checks for query before Compile() is called. More... | |
virtual bool | Compile (CQueryCompiler *compiler) |
Compile index-dependent query properties. More... | |
virtual void | Evaluate () |
evaluate query: top-level (sanity checks only) More... | |
virtual bool | CanCountUniversal () |
evaluation utility: returns true iff this is a count(*)-query; guts for CConcHolder::IsUniversalCountQuery() More... | |
virtual bool | CanCountByFile () const |
evaluation utility: returns true iff this query can count at file-level; wraps m_keys.canCountByFile() More... | |
virtual void | CountUniversal (CQueryResult &Result, size_t Limit) |
virtual void | CountLocal (CQueryResult &Result, size_t Limit) |
virtual void | ConvertCountsToHits (CQueryResult &Result, size_t Limit) |
virtual string | toString () |
DEBUG: return a canonical string form for this query More... | |
virtual string | countOptionsToString () |
virtual string | jsonClass () |
virtual string | jsonData () |
virtual void | ClearNode () |
wrapper for m_dtr->ClearNode() More... | |
virtual void | Clear (bool deep=true) |
clear query contents. if deep is true, propagates operation to daughters More... | |
virtual ddcObjectList | Children () const |
virtual void | DisownChildren () |
Public Member Functions inherited from CQuery | |
CQuery (const string &label=string("")) | |
Default constructor. More... | |
virtual | ~CQuery (void) |
virtual bool | CompileOptions (CQueryCompiler *compiler=NULL) |
virtual bool | Negated () |
For sanity checks. Default just returns false. More... | |
virtual bool | Negate () |
Toggle negation flag, returns new value. Default throws an exception. More... | |
virtual BYTE | SetMatchId (BYTE matchId) |
Set match-id, returns new value. Default throws an exception. More... | |
virtual bool | HasMatchId () const |
Returns true iff this query uses a nontrival match-id operator; default checks (this->GetMatchId() != 0) More... | |
virtual bool | RootOK () |
Is this query an admissible root of a compiled parse tree (default returns !this->Negated()) More... | |
virtual string | optionsToString () |
DEBUG: return canonical option string More... | |
virtual string | optionsToJson () |
return json format option string More... | |
virtual string | toJson () |
void | SetCompiler (CQueryCompiler *compiler) |
virtual void | ClearOptions () |
deletes m_Options if non-NULL More... | |
virtual void | SetOptions (CQueryOptions *opts) |
set global query options ; deletes any pre-existing m_Options More... | |
Public Member Functions inherited from ddcObject | |
ddcObject () | |
Default constructor. More... | |
virtual | ~ddcObject () |
virtual destructor does nothing More... | |
template<typename Visit > | |
ddcObject * | Traverse (Visit &visit) |
template<typename Visit > | |
ddcObject * | Traverse (Visit &visit) const |
template<typename Visit > | |
ddcObject * | TraverseR (Visit &visit) |
template<typename Visit > | |
ddcObject * | TraverseR (Visit &visit) const |
virtual ddcObjectList | Descendants () const |
Public Attributes | |
CQuery * | m_dtr |
underlying query conditions to be counted More... | |
size_t | m_sample |
sample size (sub-query limit) More... | |
HitSortEnum | m_sort |
sort-order one of: NoSort, (Less|Greater)ByCount(Key|Value) More... | |
string | m_lo |
maximum sort-key to return (empty for none) More... | |
string | m_hi |
minimum sort-key to return (empty for none) More... | |
CQCountKeyExprList * | m_keys |
list of count-bin metadata key expressions More... | |
CCountMap | m_Counts |
temporary for constructing count-query results More... | |
size_t | m_CountSample |
temporary for tracking count-query sample size More... | |
Public Attributes inherited from CQuery | |
string | m_Label |
arbitrary name for this query node (e.g. string from which it was parsed) More... | |
CQueryCompiler * | m_Compiler |
associated query compiler (only set on Compile()) More... | |
CQueryNode * | m_Node |
underlying CQueryNode (DDC-v1.x API) More... | |
CQueryOptions * | m_Options |
root-level options (root queries only) More... | |
Public Attributes inherited from ddcObject | |
void * | m_User |
user data associated with this object (for use e.g. by perl wrappers) More... | |
count query
|
inline |
bison constructor
References DDCDefaultCountSampleSize.
|
virtual |
Default destructor.
|
virtual |
get local match-id: keys > dtr
Reimplemented from CQuery.
bool CQCount::CompileLocal | ( | CQueryCompiler * | compiler, |
bool | compileDtr = true , |
||
bool | compileKeys = true |
||
) |
Compile index-dependent query properties.
References errParseError.
|
virtual |
Run optional unsatisfiability checks for query before Compile() is called.
Reimplemented from CQuery.
References CQuery::CheckSatisfiable().
|
virtual |
Compile index-dependent query properties.
Reimplemented from CQuery.
|
virtual |
evaluate query: top-level (sanity checks only)
Reimplemented from CQuery.
|
virtual |
evaluation utility: returns true iff this is a count(*)-query; guts for CConcHolder::IsUniversalCountQuery()
|
virtual |
evaluation utility: returns true iff this query can count at file-level; wraps m_keys.canCountByFile()
Referenced by CConcSession::GetAllHits().
|
virtual |
evaluation guts: populate m_Counts with universal counts; formerly CConcHolder::GetUniversalCounts()
References ddcVecFile< T >::begin(), ddcVecFile< T >::end(), CQCountKeyExprList::Evaluate(), CBiblIndex::FileMatches(), CHitBorders::GetBreakCollectionByName(), CConcordance::GetCorpusFilesCount(), CHitBorders::GetFileBreaks(), CConcordance::m_BiblIndex, CHitBorders::CBreakCollection::m_BreakOffsets, CQueryOptions::m_bSeparateHits, CHit::m_FileNo, CQueryOptions::m_Filters, CQueryOptions::m_HitTypeStr, CConcordance::m_MaskedFiles, CQuery::m_Options, and ddcVecFile< T >::size().
Referenced by CConcSession::GetAllHits().
|
virtual |
evaluation guts: extend m_Counts[] with counts for current search period; formerly CConcHolder::GetPeriodCounts()
References CQCountKeyExprList::CanCountByFile(), CQCountKeyExprList::Evaluate(), IsLessByFileNo::IsLessByFileNo(), CQueryOptions::IsTrivialFilter(), CQueryResult::m_AllHitsCount, CQueryOptions::m_bSeparateHits, CQueryResult::m_DebugInfo, CQueryResult::m_HighlightIds, CQueryResult::m_HighlightOccurs, CQueryResult::m_Hits, CQueryOptions::m_HitTypeStr, CQuery::m_Options, PredefinedFileBreakName, and CQueryResult::SortResultsByHitP().
Referenced by CConcSession::GetAllHits().
|
virtual |
encode count()-query results from m_Counts[] to m_Compiler->m_pHolder->m_Hits[], using m_Hits[] element CHit hit.m_SortKey.s to transport count-key and hit.m_Value.m_Count to transport count results in a backwards-compatible manner.
References GreaterByCountKey, GreaterByCountValue, hsoAscendingCountKeys, hsoAscendingCountValues, hsoDescendingCountKeys, hsoDescendingCountValues, LessByCountKey, LessByCountValue, CQueryResult::m_AllHitsCount, CQueryResult::m_bSortByString, CQueryResult::m_DebugInfo, CQueryResult::m_HighlightIds, CQueryResult::m_HighlightOccurs, CQueryResult::m_Hits, CQueryResult::m_SortOrder, and NoSort.
Referenced by CConcSession::GetAllHits().
|
virtual |
DEBUG: return a canonical string form for this query
Reimplemented from CQuery.
|
virtual |
References DDCDefaultCountSampleSize, EngMakeUpper(), Format(), HitSortEnumStrings, NoSort, and sqString().
|
inlinevirtual |
class-name for json strinfication
Reimplemented from CQuery.
|
virtual |
instance data for json stringification
Reimplemented from CQuery.
References Format(), HitSortEnumNames, and jsonStr().
|
virtual |
wrapper for m_dtr->ClearNode()
Reimplemented from CQuery.
References CQuery::ClearNode().
|
virtual |
clear query contents. if deep
is true, propagates operation to daughters
Reimplemented from CQuery.
|
virtual |
get a list of direct non-NULL CQuery direct daughters of this node
Reimplemented from CQuery.
References CQuery::Children().
|
virtual |
"disown" any direct child nodes, preventing their destruction if the current object is deleted
Reimplemented from CQuery.
References CQuery::DisownChildren().
CQuery* CQCount::m_dtr |
underlying query conditions to be counted
Referenced by CConcSession::GetAllHits().
size_t CQCount::m_sample |
sample size (sub-query limit)
Referenced by CConcSession::GetAllHits().
HitSortEnum CQCount::m_sort |
sort-order one of: NoSort, (Less|Greater)ByCount(Key|Value)
string CQCount::m_lo |
maximum sort-key to return (empty for none)
string CQCount::m_hi |
minimum sort-key to return (empty for none)
CQCountKeyExprList* CQCount::m_keys |
list of count-bin metadata key expressions
CCountMap CQCount::m_Counts |
temporary for constructing count-query results
size_t CQCount::m_CountSample |
temporary for tracking count-query sample size
Referenced by CConcSession::GetAllHits().