CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_index_TermInfo 00008 #define _lucene_index_TermInfo 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 CL_NS_DEF(index) 00015 00016 // A TermInfo is the record of information stored for a term. 00017 class TermInfo: LUCENE_BASE{ 00018 public: 00019 // The number of documents which contain the term. 00020 int32_t docFreq; 00021 00022 //A pointer into the TermFreqs file (.frq) 00023 //The .frq file contains the lists of documents which contain each term, 00024 //along with the frequency of the term in that document. 00025 int64_t freqPointer; 00026 00027 //A pointer into the TermPosition file (.prx). 00028 //The .prx file contains the lists of positions that each term 00029 //occurs at within documents. 00030 int64_t proxPointer; 00031 00032 int32_t skipOffset; 00033 00034 //Constructor 00035 TermInfo(); 00036 00037 //Constructor 00038 TermInfo(const int32_t df, const int64_t fp, const int64_t pp); 00039 00040 //Constructor 00041 //Initialises this instance by copying the values of another TermInfo ti 00042 TermInfo(const TermInfo* ti); 00043 00044 //Destructor 00045 ~TermInfo(); 00046 00047 //Sets a new document frequency, a new freqPointer and a new proxPointer 00048 void set(const int32_t docFreq, const int64_t freqPointer, const int64_t proxPointer, int32_t skipOffset); 00049 00050 //Sets a new document frequency, a new freqPointer and a new proxPointer 00051 //by copying these values from another instance of TermInfo 00052 void set(const TermInfo* ti); 00053 }; 00054 CL_NS_END 00055 #endif