1 /** @file empty_database.cc
2 * @brief Empty database internals
4 /* Copyright (C) 2017 Olly Betts
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include "empty_database.h"
25 #include "xapian/error.h"
30 static void no_subdatabases()
32 throw Xapian::InvalidOperationError("No subdatabases");
35 EmptyDatabase::size_type
36 EmptyDatabase::size() const
42 EmptyDatabase::close()
47 EmptyDatabase::open_post_list(const string
&) const
53 EmptyDatabase::open_leaf_post_list(const string
&, bool) const
59 EmptyDatabase::open_term_list(Xapian::docid
) const
66 EmptyDatabase::open_term_list_direct(Xapian::docid
) const
73 EmptyDatabase::open_allterms(const string
&) const
79 EmptyDatabase::has_positions() const
85 EmptyDatabase::open_position_list(Xapian::docid
, const string
&) const
92 EmptyDatabase::get_doccount() const
98 EmptyDatabase::get_lastdocid() const
104 EmptyDatabase::get_total_length() const
110 EmptyDatabase::get_freqs(const string
& term
,
111 Xapian::doccount
* tf_ptr
,
112 Xapian::termcount
* cf_ptr
) const
114 Assert(!term
.empty());
124 EmptyDatabase::get_value_freq(Xapian::valueno
) const
130 EmptyDatabase::get_value_lower_bound(Xapian::valueno
) const
136 EmptyDatabase::get_value_upper_bound(Xapian::valueno
) const
142 EmptyDatabase::get_doclength_lower_bound() const
148 EmptyDatabase::get_doclength_upper_bound() const
154 EmptyDatabase::get_wdf_upper_bound(const string
& term
) const
156 Assert(!term
.empty());
162 EmptyDatabase::open_value_list(Xapian::valueno
) const
168 EmptyDatabase::get_doclength(Xapian::docid did
) const
177 EmptyDatabase::get_unique_terms(Xapian::docid did
) const
185 Xapian::Document::Internal
*
186 EmptyDatabase::open_document(Xapian::docid did
, bool) const
195 EmptyDatabase::term_exists(const string
&) const
201 EmptyDatabase::open_spelling_termlist(const string
&) const
207 EmptyDatabase::open_spelling_wordlist() const
213 EmptyDatabase::get_spelling_frequency(const string
&) const
219 EmptyDatabase::open_synonym_termlist(const string
&) const
225 EmptyDatabase::open_synonym_keylist(const string
&) const
231 EmptyDatabase::get_metadata(const string
&) const
237 EmptyDatabase::open_metadata_keylist(const string
&) const
243 EmptyDatabase::write_changesets_to_fd(int,
246 Xapian::ReplicationInfo
*)
248 throw Xapian::InvalidOperationError("write_changesets_to_fd() with "
253 EmptyDatabase::get_revision() const
255 throw Xapian::InvalidOperationError("Database::get_revision() with "
260 EmptyDatabase::invalidate_doc_object(Xapian::Document::Internal
*) const
262 // This method should only be called on a single shard.
267 EmptyDatabase::get_backend_info(string
*) const
269 // This method should only be called on a single shard.
271 return BACKEND_UNKNOWN
;
275 EmptyDatabase::commit()
281 EmptyDatabase::cancel()
286 EmptyDatabase::begin_transaction(bool)
292 EmptyDatabase::end_transaction_(bool)
298 EmptyDatabase::add_document(const Xapian::Document
&)
305 EmptyDatabase::delete_document(Xapian::docid
)
311 EmptyDatabase::delete_document(const string
&)
317 EmptyDatabase::replace_document(Xapian::docid
, const Xapian::Document
&)
323 EmptyDatabase::replace_document(const string
&, const Xapian::Document
&)
330 EmptyDatabase::add_spelling(const string
&, Xapian::termcount
) const
336 EmptyDatabase::remove_spelling(const string
&, Xapian::termcount
) const
343 EmptyDatabase::add_synonym(const string
&, const string
&) const
349 EmptyDatabase::remove_synonym(const string
&, const string
&) const
355 EmptyDatabase::clear_synonyms(const string
&) const
361 EmptyDatabase::set_metadata(const string
&, const string
&)
367 EmptyDatabase::get_description() const