Doxygen
Loading...
Searching...
No Matches
SearchIndex::IndexWord Class Reference
Collaboration diagram for SearchIndex::IndexWord:

Public Types

using URLInfoMap = std::unordered_map<int,URLInfo>

Public Member Functions

 IndexWord (const DString &word)
void addUrlIndex (int, bool)
URLInfoMap urls () const
DString word () const

Private Attributes

DString m_word
URLInfoMap m_urls

Detailed Description

Definition at line 79 of file searchindex.h.

Member Typedef Documentation

◆ URLInfoMap

using SearchIndex::IndexWord::URLInfoMap = std::unordered_map<int,URLInfo>

Definition at line 82 of file searchindex.h.

Constructor & Destructor Documentation

◆ IndexWord()

SearchIndex::IndexWord::IndexWord ( const DString & word)
inline

Definition at line 83 of file searchindex.h.

83: m_word(word) {}
DString word() const
Definition searchindex.h:86

References m_word, and word().

Member Function Documentation

◆ addUrlIndex()

void SearchIndex::IndexWord::addUrlIndex ( int idx,
bool hiPriority )

Definition at line 52 of file searchindex.cpp.

53{
54 //printf("IndexWord::addUrlIndex(%d,%d)\n",idx,hiPriority);
55 auto it = m_urls.find(idx);
56 if (it==m_urls.end())
57 {
58 //printf("URLInfo::URLInfo(%d)\n",idx);
59 it = m_urls.emplace(idx,URLInfo(idx,0)).first;
60 }
61 it->second.freq+=2;
62 if (hiPriority) it->second.freq|=1; // mark as high priority document
63}

References m_urls.

◆ urls()

URLInfoMap SearchIndex::IndexWord::urls ( ) const
inline

Definition at line 85 of file searchindex.h.

85{ return m_urls; }

References m_urls.

◆ word()

DString SearchIndex::IndexWord::word ( ) const
inline

Definition at line 86 of file searchindex.h.

86{ return m_word; }

References m_word.

Referenced by IndexWord().

Member Data Documentation

◆ m_urls

URLInfoMap SearchIndex::IndexWord::m_urls
private

Definition at line 90 of file searchindex.h.

Referenced by addUrlIndex(), and urls().

◆ m_word

DString SearchIndex::IndexWord::m_word
private

Definition at line 89 of file searchindex.h.

Referenced by IndexWord(), and word().


The documentation for this class was generated from the following files: