25 #ifndef OM_HGUARD_INMEMORY_DATABASE_H 26 #define OM_HGUARD_INMEMORY_DATABASE_H 57 positions.insert(positions.end(),
61 sort(positions.begin(), positions.end());
75 positions.insert(positions.end(),
79 sort(positions.begin(), positions.end());
142 vector<InMemoryPosting>::const_iterator
pos;
143 vector<InMemoryPosting>::const_iterator
end;
157 const InMemoryTerm & imterm,
const std::string & term_);
178 string get_description()
const;
214 string get_description()
const;
222 vector<InMemoryTermEntry>::const_iterator
pos;
223 vector<InMemoryTermEntry>::const_iterator
end;
242 string get_termname()
const;
247 TermList * skip_to(
const std::string & term);
286 void make_term(
const string & tname);
294 const map<Xapian::valueno, string>& values_);
297 const string & tname,
301 bool use_position =
true);
342 void get_freqs(
const string & term,
348 bool term_exists(
const string & tname)
const;
349 bool has_positions()
const;
351 LeafPostList * open_post_list(
const string & tname)
const;
356 std::string get_metadata(
const std::string & key)
const;
357 TermList * open_metadata_keylist(
const std::string &prefix)
const;
358 void set_metadata(
const std::string & key,
const std::string & value);
361 const string & tname)
const;
363 const string & tname)
const;
364 TermList * open_allterms(
const string & prefix)
const;
369 if (path) *path = string();
Xapian::Internal::intrusive_ptr< const InMemoryDatabase > db
PositionList from an InMemory DB or a Document object.
vector< InMemoryPosting >::const_iterator end
vector< InMemoryTermEntry >::const_iterator end
Define the XAPIAN_NORETURN macro.
virtual void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
Abstract base class for postlists.
vector< Xapian::termpos > positions
Xapian::docid did
The document ID of the document in that database.
A database held entirely in memory.
void merge(const InMemoryPosting &post)
Xapian::termcount wdf_upper_bound
Base class for databases.
int get_backend_info(string *path) const
Get backend information about this database.
friend class InMemoryAllDocsPostList
XAPIAN_TOTALLENGTH_TYPE totallength
The total length of all documents in a database.
TermList * open_term_list() const
Open a term list.
Xapian::totallength totlen
virtual Xapian::termcount get_wdf_upper_bound(const std::string &term) const
Get an upper bound on the wdf of term term.
vector< Xapian::termcount > doclengths
A document in the database, possibly plus modifications.
Abstract base class for termlists.
vector< InMemoryTermEntry >::const_iterator pos
Abstract base class for leaf postlists.
static void throw_database_closed()
Abstract base class for leaf postlists.
vector< Xapian::termpos > positions
Xapian::termcount document_length
virtual void delete_document(Xapian::docid did)
Delete a document in the database.
PositionList * open_position_list(Xapian::docid did, const string &tname) const
Open a position list for the given term in the given document.
vector< InMemoryPosting > docs
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
void merge(const InMemoryTermEntry &post)
Class representing a document and the terms indexing it.
InMemoryPositionList mypositions
List of positions of the current term.
friend class InMemoryDatabase
InMemoryDatabase::open_document() needs to call our private constructor.
vector< InMemoryTermEntry > terms
Xapian::termcount collection_freq
InMemoryDoc(bool is_valid_)
std::map< string, string > metadata
A PostList in an inmemory database.
A position list in a inmemory database.
std::map< Xapian::valueno, ValueStats > valuestats
Class for iterating over term positions.
Xapian::Internal::intrusive_ptr< const InMemoryDatabase > db
vector< std::map< Xapian::valueno, string > > valuelists
Xapian::doccount termfreq
A document read from a InMemoryDatabase.
Xapian::termcount get_unique_terms(Xapian::docid did) const
Get the number of unique term in document.
void operator=(const InMemoryDocument &)
Don't allow assignment.
vector< std::string > doclists
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Xapian::termcount positionlist_count(Xapian::docid did, const string &tname) const
map< string, InMemoryTerm > postlists
bool locked() const
Return true if the database is open for writing.
Xapian::Internal::intrusive_ptr< const InMemoryDatabase > db
Collates statistics while calculating term weight in an ESet.
unsigned valueno
The number for a value slot in a document.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Xapian::termcount get_doclength(Xapian::docid did) const
Get the length of a given document.
Abstract base class for termlists.
vector< InMemoryPosting >::const_iterator pos
Various assertion macros.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Abstract base class for iterating term positions in a document.
API for working with documents.
A handle representing a document in a Xapian database.
A PostList over all docs in an inmemory database.
Xapian::termcount term_freq
vector< InMemoryDoc > termlists