Features removed from Xapian¶
Table of contents
Native C++ API¶
Removed | Feature name | Upgrade suggestion and comments |
---|---|---|
1.0.0 | QueryParser::set_stemming_options() | Use
If a third parameter is passed, |
1.0.0 | Enquire::set_sort_forward() | Use
|
1.0.0 | Enquire::set_sorting() | Use
|
1.0.0 | Stem::stem_word(word) | Use Stem::operator()(word) instead. |
1.0.0 | Auto::open(path) | Use the Database(path) constructor instead. |
1.0.0 | Auto::open(path, action) | Use the WritableDatabase(path, action) constructor instead. |
1.0.0 | Query::is_empty() | Use Query::empty() instead. |
1.0.0 | Document::add_term_nopos() | Use Document::add_term() instead. |
1.0.0 | Enquire::set_bias() | Use PostingSource instead (new in 1.2). |
1.0.0 | ExpandDecider::operator() | Return type is now bool not int . |
1.0.0 | MatchDecider::operator() | Return type is now bool not int . |
1.0.0 | Error::get_type() | Return type is now const char * not std::string . Most existing code
won’t need changes, but if it does the simplest fix is to write
std::string(e.get_type()) instead of e.get_type() . |
1.0.0 | <xapian/output.h> | Use cout << obj.get_description(); instead of cout << obj; |
1.0.0 | Several constructors marked as explicit. | Explicitly create the object type required, for example use
Xapian::Enquire enq(Xapian::Database(path)); instead of
Xapian::Enquire enq(path); |
1.0.0 | QueryParser::parse_query() throwing
const char * exception. |
Catch Xapian::QueryParserError instead of const char * , and call
get_msg() on the caught object. If you need to build with either version,
catch both (you’ll need to compile the part which catches QueryParserError
conditionally, since this exception isn’t present in the 0.9 release series). |
1.1.0 | xapian_version_string() | Use version_string() instead. |
1.1.0 | xapian_major_version() | Use major_version() instead. |
1.1.0 | xapian_minor_version() | Use minor_version() instead. |
1.1.0 | xapian_revision() | Use revision() instead. |
1.1.0 | Enquire::include_query_terms | Use Enquire::INCLUDE_QUERY_TERMS instead. |
1.1.0 | Enquire::use_exact_termfreq | Use Enquire::USE_EXACT_TERMFREQ instead. |
1.1.0 | Error::get_errno() | Use Error::get_error_string() instead. |
1.1.0 | Enquire::register_match_decider() | This method didn’t do anything, so just remove calls to it! |
1.1.0 | Query::Query(Query::op, Query) | This constructor isn’t useful for any currently implemented
Query::op . |
1.1.0 | The Quartz backend | Use the Chert backend instead. |
1.1.0 | Quartz::open() | Use Chert::open() instead. |
1.1.0 | quartzcheck | Use xapian-check instead. |
1.1.0 | quartzcompact | Use xapian-compact instead. |
1.1.0 | quartzdump | Use xapian-inspect instead. |
1.1.0 | configure –enable-debug | configure –enable-assertions |
1.1.0 | configure –enable-debug=full | configure –enable-assertions –enable-log |
1.1.0 | configure –enable-debug=partial | configure –enable-assertions=partial |
1.1.0 | configure –enable-debug=profile | configure –enable-log=profile |
1.1.0 | configure –enable-debug-verbose | configure –enable-log |
1.1.0 | Database::positionlist_begin()
throwing RangeError if the
term specified doesn’t index the
document specified. |
This check is quite expensive, and often you don’t care. If you
do it’s easy to check - just open a TermListIterator for the
document and use skip_to() to check if the term is there. |
1.1.0 | Database::positionlist_begin()
throwing DocNotFoundError if
the document specified doesn’t
exist. |
This check is quite expensive, and often you don’t care. If you
do, it’s easy to check - just call Database::get_document() with the
specified document ID. |
1.1.5 | delve -k | Accepted as an undocumented alias for -V since 0.9.10 for compatibility with 0.9.9 and earlier. Just use -V instead. |
1.3.0 | The Flint backend | Use the Chert backend instead. |
1.3.0 | Flint::open() | Use Chert::open() instead. |
1.3.0 | xapian-chert-update | Install Xapian 1.2.x (where x >= 5) to update chert databases from 1.1.3 and earlier. |
1.3.0 | Default second parameter to
Enquire sorting functions. |
The parameter name was The methods affected are:
To update them, just add a second parameter with value |
1.3.0 | Sorter abstract base class. |
Use KeyMaker class instead, which has the same semantics, but has been renamed
to indicate that the keys produced may be used for purposes other than sorting (we
plan to allow collapsing on generated keys in the future). |
1.3.0 | MultiValueSorter class. |
Use MultiValueSorter sorter;
// Primary ordering is forwards on value 4.
sorter.add(4);
// Secondary ordering is reverse on value 5.
sorter.add(5, false);
becomes: MultiValueKeyMaker sorter;
// Primary ordering is forwards on value 4.
sorter.add_value(4);
// Secondary ordering is reverse on value 5.
sorter.add_value(5, true);
|
1.3.0 | matchspy parameter to
Enquire::get_mset() |
Use the newer MatchSpy class and Enquire::add_matchspy() method instead. |
1.3.0 | Xapian::timeout typedef |
Use unsigned instead, which should also work with older Xapian releases. |
1.3.0 | Xapian::percent typedef |
Use int instead, which should also work with older Xapian releases. |
1.3.0 | Xapian::weight typedef |
Use double instead, which should also work with older Xapian releases. |
1.3.0 | Xapian::Query::unserialise()
throws
Xapian::SerialisationError not
Xapian::InvalidArgumentError
for errors in serialised data |
To be compatible with older and newer Xapian, you can catch both exceptions. |
1.3.2 | The Brass backend | Use the Glass backend instead. |
1.3.2 | Xapian::Brass::open() |
Use the constructor with Xapian::DB_BACKEND_GLASS flag (new in 1.3.2) instead. |
1.3.4 | Copy constructors and assignment
operators for classes:
Xapian::ExpandDecider ,
Xapian::FieldProcessor (new in
1.3.1), Xapian::KeyMaker ,
Xapian::MatchDecider ,
Xapian::StemImplementation ,
Xapian::Stopper and
Xapian::ValueRangeProcessor . |
We think it was a mistake that implicit copy constructors and assignment operators were being provided for these functor classes - it’s hard to use them correctly, but easy to use them in ways which compile but don’t work correctly, and we doubt anyone is intentionally using them, so we’ve simply removed them. For more information, see https://trac.xapian.org/ticket/681 |
1.3.5 | Xapian::DBCHECK_SHOW_BITMAP |
Use Xapian::DBCHECK_SHOW_FREELIST (added in 1.3.2) instead.
Xapian::DBCHECK_SHOW_BITMAP was added in 1.3.0, so has never been in a stable
release. |
Bindings¶
Removed | Language | Feature name | Upgrade suggestion and comments |
---|---|---|---|
1.0.0 | SWIG [1] | Enquire::set_sort_forward() | Use
|
1.0.0 | SWIG [1] | Enquire::set_sorting() | Use
|
1.0.0 | SWIG [1] | Auto::open(path) | Use the Database(path) constructor instead. |
1.0.0 | SWIG [1] | Auto::open(path, action) | Use the WritableDatabase(path, action) constructor instead. |
1.0.0 | SWIG [3] | MSet::is_empty() | Use MSet::empty() instead. |
1.0.0 | SWIG [3] | ESet::is_empty() | Use ESet::empty() instead. |
1.0.0 | SWIG [3] | RSet::is_empty() | Use RSet::empty() instead. |
1.0.0 | SWIG [3] | Query::is_empty() | Use Query::empty() instead. |
1.0.0 | SWIG [1] | Document::add_term_nopos() | Use Document::add_term() instead. |
1.0.0 | CSharp | ExpandDecider::Apply() | Return type is now bool instead of int . |
1.0.0 | CSharp | MatchDecider::Apply() | Return type is now bool instead of int . |
1.0.0 | SWIG [1] | Stem::stem_word(word) | Use Stem::operator()(word) instead. [4] |
1.1.0 | SWIG [1] | xapian_version_string() | Use version_string() instead. |
1.1.0 | SWIG [1] | xapian_major_version() | Use major_version() instead. |
1.1.0 | SWIG [1] | xapian_minor_version() | Use minor_version() instead. |
1.1.0 | SWIG [1] | xapian_revision() | Use revision() instead. |
1.1.0 | SWIG [1] | ESetIterator::get_termname() | Use ESetIterator::get_term() instead. This change is intended to
bring the ESet iterators in line with other term iterators, which all
support get_term() instead of get_termname() . |
1.1.0 | Python | get_description() | All get_description() methods have been renamed to __str__() ,
so the normal python str() function can be used. |
1.1.0 | Python | MSetItem.get_*() | All these methods are deprecated, in favour of properties.
To convert, just change msetitem.get_FOO() to msetitem.FOO |
1.1.0 | Python | Enquire.get_matching_terms | Replaced by Enquire.matching_terms , for consistency with
rest of Python API. Note: an Enquire.get_matching_terms method existed in
releases up-to and including 1.2.4, but this was actually an old implementation
which only accepted a MSetIterator as a parameter, and would have failed with
code written expecting the version in 1.0.0. It was fully removed after
release 1.2.4. |
1.1.0 | SWIG [1] | Error::get_errno() | Use Error::get_error_string() instead. |
1.1.0 | SWIG [2] | MSet::get_document_id() | Use MSet::get_docid() instead. |
1.2.0 | Python | mset[i][xapian.MSET_DID] etc | This was inadvertently removed in 1.2.0, but not noticed until 1.2.5, by which
point it no longer seemed worthwhile to reinstate it. Please use the property
API instead, e.g. mset[i].docid , mset[i].weight , etc. |
1.2.5 | Python | if idx in mset | This was nominally implemented, but never actually worked. Since nobody seems
to have noticed in 3.5 years, we just removed it. If you have uses (which were
presumably never called), you can replace them with:
if idx >= 0 and idx < len(mset) |
1.3.0 | Python | Non-pythonic iterators | Use the pythonic iterators instead. |
1.3.0 | Python | Stem_get_available_languages | Use Stem.get_available_languages instead (static method instead of function) |
[1] | (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) This affects all SWIG generated bindings (currently: Python, PHP, Ruby, Tcl8 and CSharp) |
[2] | This affects all SWIG-generated bindings except those for Ruby, support for which was added after the function was deprecated in Xapian-core. |
[3] | (1, 2, 3, 4) This affects all SWIG generated bindings except those for Ruby, which was added after the function was deprecated in Xapian-core, and PHP, where empty is a reserved word (and therefore, the method remains “is_empty”). |
[4] | Python handles this like C++. Ruby renames it to ‘call’ (idiomatic Ruby). PHP renames it to ‘apply’. CSharp to ‘Apply’ (delegates could probably be used to provide C++-like functor syntax, but that’s effort and it seems debatable if it would actually be more natural to a C# programmer). Tcl8 renames it to ‘apply’ - need to ask a Tcl type if that’s the best solution. |
Omega¶
Removed | Feature name | Upgrade suggestion and comments |
---|---|---|
1.0.0 | $freqs | Use $map{$queryterms,$_: $nice{$freq{$_}}} instead. |
1.0.0 | scriptindex -u | -u was ignored for compatibility with 0.7.5 and earlier, so just remove it. |
1.0.0 | scriptindex -q | -q was ignored for compatibility with 0.6.1 and earlier, so just remove it. |
1.1.0 | scriptindex index=nopos | Use indexnopos instead. |
1.3.0 | OLDP CGI parameter |
Use xP CGI parameter instead (direct replacement), which has been supported
since at least 0.5.0. |