#include <IndexBuilder.hpp>
Public Member Functions | |
IndexBuilder (RecordReader< Value > *reader=new InvertedFileReader< Value >) | |
~IndexBuilder () | |
void | build (const Configuration &config) throw (std::exception) |
Static Public Attributes | |
static const std::string | header_file |
Private Types | |
typedef std::vector< FILE * > | FileVector |
typedef Configuration::Sorting | Sorting |
typedef std::tr1::unordered_map < std::string, PostlistBuilder::SharedPointer > | BuilderMap |
Private Member Functions | |
void | index_random_records_ () throw (std::exception) |
void | index_sorted_records_ () throw (std::exception) |
bfs::path | partition_records_ () throw (std::exception) |
Static Private Member Functions | |
static void | build_postlists (const bfs::path &path, BuilderMap &builders) throw (std::exception) |
static const Configuration & | check_config (const Configuration &config) throw (std::exception) |
static void | store_header (const Header &header, const bfs::path &path) throw (std::exception) |
static void | print_header (const Header &header) |
Private Attributes | |
Header | header_ |
Configuration | config_ |
RecordReader< Value > * | reader_ |
Static Private Attributes | |
static const std::string | tmp_dir |
static const std::string | tmp_file |
A class to create an inverted index with external storage.
Created on Jun 22, 2008
Definition at line 28 of file IndexBuilder.hpp.
typedef std::tr1::unordered_map<std::string, PostlistBuilder::SharedPointer> aitools::invertedindex::IndexBuilder< Value >::BuilderMap [private] |
Definition at line 23 of file IndexBuilder.hpp.
typedef std::vector<FILE*> aitools::invertedindex::IndexBuilder< Value >::FileVector [private] |
Definition at line 20 of file IndexBuilder.hpp.
typedef Configuration::Sorting aitools::invertedindex::IndexBuilder< Value >::Sorting [private] |
Definition at line 21 of file IndexBuilder.hpp.
aitools::invertedindex::IndexBuilder< Value >::IndexBuilder | ( | RecordReader< Value > * | reader = new InvertedFileReader<Value> |
) | [inline] |
The excplicit constructor.
Definition at line 112 of file IndexBuilder.hpp.
aitools::invertedindex::IndexBuilder< Value >::~IndexBuilder | ( | ) | [inline] |
The destructor.
Definition at line 119 of file IndexBuilder.hpp.
void aitools::invertedindex::IndexBuilder< Value >::build | ( | const Configuration & | config | ) | throw (std::exception) [inline, virtual] |
Implements aitools::invertedindex::Builder.
Definition at line 212 of file IndexBuilder.hpp.
Referenced by aitools::invertedindex::build_ngram_index().
void aitools::invertedindex::IndexBuilder< Value >::build_postlists | ( | const bfs::path & | path, | |
BuilderMap & | builders | |||
) | throw (std::exception) [inline, static, private] |
Reads all generic records from the file pointed by bucket and stores their values in postlists that will be created for each key that occurs. All postlists will be inserted into the postlists map.
bucket | A file with serialized generic records. | |
postlists | A key-to-postlist map. |
Definition at line 129 of file IndexBuilder.hpp.
const Configuration & aitools::invertedindex::IndexBuilder< Value >::check_config | ( | const Configuration & | config | ) | throw (std::exception) [inline, static, private] |
Definition at line 151 of file IndexBuilder.hpp.
void aitools::invertedindex::IndexBuilder< Value >::index_random_records_ | ( | ) | throw (std::exception) [inline, private] |
Definition at line 236 of file IndexBuilder.hpp.
void aitools::invertedindex::IndexBuilder< Value >::index_sorted_records_ | ( | ) | throw (std::exception) [inline, private] |
Definition at line 286 of file IndexBuilder.hpp.
bfs::path aitools::invertedindex::IndexBuilder< Value >::partition_records_ | ( | ) | throw (std::exception) [inline, private] |
Definition at line 358 of file IndexBuilder.hpp.
void aitools::invertedindex::IndexBuilder< Value >::print_header | ( | const Header & | header | ) | [inline, static, private] |
Definition at line 196 of file IndexBuilder.hpp.
void aitools::invertedindex::IndexBuilder< Value >::store_header | ( | const Header & | header, | |
const bfs::path & | path | |||
) | throw (std::exception) [inline, static, private] |
Definition at line 179 of file IndexBuilder.hpp.
Configuration aitools::invertedindex::IndexBuilder< Value >::config_ [private] |
Definition at line 82 of file IndexBuilder.hpp.
Header aitools::invertedindex::IndexBuilder< Value >::header_ [private] |
Definition at line 81 of file IndexBuilder.hpp.
const std::string aitools::invertedindex::IndexBuilder< Value >::header_file [inline, static] |
Definition at line 32 of file IndexBuilder.hpp.
RecordReader<Value>* aitools::invertedindex::IndexBuilder< Value >::reader_ [private] |
Definition at line 83 of file IndexBuilder.hpp.
const std::string aitools::invertedindex::IndexBuilder< Value >::tmp_dir [inline, static, private] |
Definition at line 27 of file IndexBuilder.hpp.
const std::string aitools::invertedindex::IndexBuilder< Value >::tmp_file [inline, static, private] |
Definition at line 28 of file IndexBuilder.hpp.