|
JASSv2
|
Non-thread-safe object that accumulates a single postings list during indexing. More...
#include <index_postings.h>

Classes | |
| class | posting |
| The representation of a single postings as a tuple of docid, term frequency and position. More... | |
Public Member Functions | |
| index_postings (allocator &memory_pool) | |
| Constructor. More... | |
| virtual void | push_back (JASS::compress_integer::integer document_id, index_postings_impact::impact_type amount=1) |
| Add to the end of the postings list for this term a term frequency of the given amount. More... | |
| virtual void | push_back (const std::vector< JASS::posting > &data) |
| Add a set of postings to the end of the postings list (warning) More... | |
| compress_integer::integer | linearize (uint8_t *temporary, size_t temporary_size, compress_integer::integer *ids, index_postings_impact::impact_type *frequencies, size_t id_and_frequencies_length) const |
| Turn the internal format used to accumulate postings into a docid and term-frequencies array. More... | |
| void | impact_order (size_t documents_in_collection, index_postings_impact &postings_list) const |
| Return the postings list impact ordered postings list with impact headers. More... | |
| void | impact_order (size_t documents_in_collection, index_postings_impact &postings_list, compress_integer::integer document_frequency, compress_integer::integer *document_ids, index_postings_impact::impact_type *term_frequencies) const |
| Return the postings list impact ordered postings list with impact headers. More... | |
| void | text_render (std::ostream &stream) const |
| Dump a human-readable version of the postings list down the stream. Format is: <DocID, TF, Pos, Pos, Pos>... More... | |
Static Public Member Functions | |
| static void | unittest (void) |
| Unit test this class. | |
Private Attributes | |
| compress_integer::integer | highest_document |
| The higest document number seen in this postings list (counting from 1) | |
| dynamic_array< uint8_t > | document_ids |
| Array holding the docids (variable byte encoded) | |
| dynamic_array< index_postings_impact::impact_type > | term_frequencies |
| Array holding the term frequencies (as integers) | |
Static Private Attributes | |
| static constexpr size_t | initial_size = 16 |
| Initially allocate space for 4 elements. | |
| static constexpr double | growth_factor = 1.5 |
| Grow dynamic arrays by a factor of 1.5. | |
Non-thread-safe object that accumulates a single postings list during indexing.
|
inline |
Constructor.
| memory_pool | [in] All allocation is from this allocator. |
|
inline |
Return the postings list impact ordered postings list with impact headers.
| documents_in_collection | [in] The number of documents in the collection, |
| postings_list | [in / out] The constructed impact ordered postings list. |
|
inline |
Return the postings list impact ordered postings list with impact headers.
| documents_in_collection | [in] The number of documents in the collection, |
| postings_list | [out] The constructed impact ordered postings list. |
| document_frequency | [in] the document frequency of this term (the length of id_list and tf_list). |
| document_ids | [in] The list of document ids. |
| term_frequencies | [in] The list of term frequencies. |
|
inline |
Turn the internal format used to accumulate postings into a docid and term-frequencies array.
| temporary | [in] Buffer used as scratch space. |
| temporary_size | [in] Length, in bytes, of temporary. |
| ids | [out] Buffer to store the document ids. |
| frequencies | [out] Buffer to store the term frequencies. |
| id_and_frequencies_length | [in] The length of the id and frequencies buffers. |
|
inlinevirtual |
Add to the end of the postings list for this term a term frequency of the given amount.
| document_id | [in] The document whose term count is to be incremented. |
| amount | [in] The amount to add to the score. default = 1. |
The amount is generally not useful unless pre-computed term frequencies (or impact scores) are known in advance. This might happen if a forward index is being inverted (i.e. term:count values are known).
|
inlinevirtual |
Add a set of postings to the end of the postings list (warning)
This method assumes the caller is either adding postings to an index one at a time or is adding postings to an index block at a time. WARNING: it with JASS_assert() if there are already postings in the index from the document-at-a-time adding approach.
| data | [in] The postings list to use. Document ids are assumed to be D1-encoded. |
|
inline |
Dump a human-readable version of the postings list down the stream. Format is: <DocID, TF, Pos, Pos, Pos>...
| stream | [in] The stream to write to. |
1.8.13