Remove deprecated compaction API
[xapian.git] / xapian-core / docs / deprecation.rst
blobbe06e338135c6485c8391954f1aeef733e4dc293
2 .. This document was originally written by Richard Boulton.
4 .. Copyright (C) 2007 Lemur Consulting Ltd
5 .. Copyright (C) 2007,2008,2009,2010,2011,2012,2013,2015,2016 Olly Betts
7 ===========
8 Deprecation
9 ===========
11 .. contents:: Table of contents
13 Introduction
14 ============
16 Xapian's API is fairly stable and has been polished piece by piece over time,
17 but it still occasionally needs to be changed.  This may be because a new
18 feature has been implemented and the interface needs to allow access to it, but
19 it may also be required in order to polish a rough edge which has been missed
20 in earlier versions of Xapian, or simply to reflect an internal change which
21 requires a modification to the external interface.
23 We aim to make such changes in a way that allows developers to work against a
24 stable API, while avoiding the need for the Xapian developers to maintain too
25 many old historical interface artefacts.  This document describes the process
26 we use to deprecate old pieces of the API, lists parts of the API which are
27 currently marked as deprecated, and also describes parts of the API which have
28 been deprecated for some time, and are now removed from the Xapian library.
30 It is possible for functions, methods, constants, types or even whole classes
31 to be deprecated, but to save words this document will often use the term
32 "features" to refer collectively to any of these types of interface items.
35 Deprecation Procedure
36 =====================
38 Deprecation markers
39 -------------------
41 At any particular point, some parts of the C++ API will be marked as
42 "deprecated".  Deprecated features are annotated in the API headers with macros
43 such as ``XAPIAN_DEPRECATED()``, which will cause compilers with appropriate
44 support (such as GCC 3.1 or later, and MSVC 7.0 or later) to emit compile-time
45 warnings if these features are used.
47 If a feature is marked with one of these markers, you should avoid using it in
48 new code, and should migrate your code to use a replacement when possible.  The
49 documentation comments for the feature, or the list at the end
50 of this file, will describe possible alternatives to the deprecated feature.
52 If you want to disable deprecation warnings temporarily, you can do so
53 by passing ``"-DXAPIAN_DEPRECATED(X)=X"`` to the compiler (the quotes are
54 needed to protect the brackets from the shell).  If your build system uses
55 make, you might do this like so::
57     make 'CPPFLAGS="-DXAPIAN_DEPRECATED(X)=X"'
59 API and ABI compatibility
60 -------------------------
62 Releases are given three-part version numbers (e.g. 1.2.9), the three parts
63 being termed "major" (1), "minor" (2), and "revision" (9).  Releases with
64 the same major and minor version are termed a "release series".
66 For Xapian releases 1.0.0 and higher, an even minor version indicates a stable
67 release series, while an odd minor version indicates a development release
68 series.
70 Within a stable release series, we strive to maintain API and ABI forwards
71 compatibility.  This means that an application written and compiled against
72 version `X.Y.a` of Xapian should work, without any source changes or need to
73 recompile, with a later version `X.Y.b`, for all `b` >= `a`.
74 Stable releases which increase the minor or major version number will usually
75 change the ABI incompatibly (so that code will need to be recompiled against
76 the newer release series.  They may also make incompatible API changes,
77 though we will attempt to do this in a way which makes it reasonably easy to
78 migrate applications, and document how to do so in this document.
80 It is possible that a feature may be marked as deprecated within a minor
81 release series - that is from version `X.Y.c`
82 onwards, where `c` is not zero.  The API and ABI will not be changed by this
83 deprecation, since the feature will still be available in the API (though the
84 change may cause the compiler to emit new warnings when rebuilding code
85 which uses the now-deprecated feature).
87 Users should generally be able to expect working code which uses Xapian not to
88 stop working without reason.  We attempt to codify this in the following
89 policy, but we reserve the right not to slavishly follow this.  The spirit of
90 the rule should kept in mind - for example if we discovered a feature which
91 didn't actually work, making an incompatible API change at the next ABI bump
92 would be reasonable.
94 Normally a feature will be supported after being deprecated for an entire
95 stable release series.  For example, if a feature is deprecated in release
96 1.2.0, it will be supported for the entire 1.2.x release series, and removed in
97 development release 1.3.0.  If a feature is deprecated in release 1.2.1, it
98 will be supported for the 1.2.x *and* 1.4.x stable release series (and of
99 course the 1.3.x release series in between), and won't be removed until
100 1.5.0.
102 Experimental features
103 ---------------------
105 During a development release series (such as the 1.1.x series), some features
106 may be marked as "experimental".  Such features are liable to change without
107 going through the normal deprecation procedure.  This includes changing on-disk
108 formats for data stored by the feature, and breaking API and ABI compatibility
109 between releases for the feature.  Such features are included in releases to
110 get wider use and corresponding feedback about them.
112 Deprecation in the bindings
113 ---------------------------
115 When the Xapian API changes, the interface provided by the Xapian bindings will
116 usually change in step.  In addition, it is sometimes necessary to change the
117 way in which Xapian is wrapped by bindings - for example, to provide a better
118 convenience wrapper for iterators in Python.  Again, we aim to ensure that an
119 application written (and compiled, if the language being bound is a compiled
120 language) for version `X.Y.a` of Xapian should work without any changes or need
121 to recompile, with a later version `X.Y.b`, for all `a` <= `b`.
123 However, the bindings are a little less mature than the core C++ API, so we
124 don't intend to give the same guarantee that a feature present and not
125 deprecated in version `X.Y.a` will work in all versions `X+1.Y.b`.  In other
126 words, we may remove features which have been deprecated without waiting for
127 an entire release series to pass.
129 Any planned deprecations will be documented in the list of deprecations and
130 removed features at the end of this file.
132 Support for Other Software
133 ==========================
135 Support for other software doesn't follow the same deprecation rules as
136 for API features.
138 Our guiding principle for supporting version of other software is that
139 we don't aim to actively support versions which are no longer supported
140 "upstream".
142 So Xapian 1.1.0 doesn't support PHP4 because the PHP team no longer did
143 when it was released.  By the API deprecation rules we should have announced
144 this when Xapian 1.0.0 was released, but we don't have control over when and
145 to what timescales other software providers discontinue support for older
146 versions.
148 Sometimes we can support such versions without extra effort (e.g. Tcl's
149 stubs mechanism means Tcl 8.1 probably still works, even though the last
150 8.1.x release was over a decade ago), and in some cases Linux distros
151 continue to support software after upstream stops.
153 But in most cases keeping support around is a maintenance overhead and
154 we'd rather spend our time on more useful things.
156 Note that there's no guarantee that we will support and continue to
157 support versions just because upstream still does.  For example, we ceased
158 providing backported packages for Ubuntu dapper with Xapian 1.1.0 - in this
159 case, it's because we felt that if you're conservative enough to run dapper,
160 you'd probably prefer to stick with 1.0.x until you upgrade to hardy (the next
161 Ubuntu LTS release).  But we may decide not to support versions for other
162 reasons too.
164 How to avoid using deprecated features
165 ======================================
167 We recommend taking the following steps to avoid depending on deprecated
168 features when writing your applications:
170  - If at all possible, test compile your project using a compiler which
171    supports warnings about deprecated features (such as GCC 3.1 or later), and
172    check for such warnings.  Use the -Werror flag to GCC to ensure that you
173    don't miss any of them.
175  - Check the NEWS file for each new release for details of any new features
176    which are deprecated in the release.
178  - Check the documentation comments, or the automatically extracted API
179    documentation, for each feature you use in your application.  This
180    documentation will indicate features which are deprecated, or planned for
181    deprecation.
183  - For applications which are not written in C++, there is currently no
184    equivalent of the ``XAPIAN_DEPRECATED`` macro for the bindings, and thus
185    there is no way for the bindings to give a warning if a deprecated feature
186    is used.  This would be a nice addition for those languages in which there
187    is a reasonable way to give such warnings.  Until such a feature is
188    implemented, all application writers using the bindings can do is to check
189    the list of deprecated features in each new release, or lookup the features
190    they are using in the list at the end of this file.
193 Features currently marked for deprecation
194 =========================================
196 Native C++ API
197 --------------
199 .. Substitution definitions for feature names which are two wide for the column:
201 .. |set_max_wildcard_expansion| replace:: ``Xapian::QueryParser::set_max_wildcard_expansion()``
202 .. |flush| replace:: ``Xapian::WritableDatabase::flush()``
203 .. |VRP| replace:: ``Xapian::ValueRangeProcessor``
204 .. |DateVRP| replace:: ``Xapian::DateValueRangeProcessor``
205 .. |NumberVRP| replace:: ``Xapian::NumberValueRangeProcessor``
206 .. |StringVRP| replace:: ``Xapian::StringValueRangeProcessor``
207 .. |add_valuerangeprocessor| replace:: ``Xapian::QueryParser::add_valuerangeprocessor()``
209 .. Keep table width to <= 126 columns.
211 ========== ====== =================================== ========================================================================
212 Deprecated Remove Feature name                        Upgrade suggestion and comments
213 ========== ====== =================================== ========================================================================
214 1.3.1      1.5.0  ``Xapian::ErrorHandler``            We feel the current ErrorHandler API doesn't work at the right level (it
215                                                       only works in Enquire, whereas you should be able to handle errors at
216                                                       the Database level too) and we can't find any evidence that people are
217                                                       actually using it.  So we've made the API a no-op and marked it as
218                                                       deprecated.  The hope is to replace it with something better thought
219                                                       out, probably during the 1.4.x release series.  There's some further
220                                                       thoughts at https://trac.xapian.org/ticket/3#comment:8
221 ---------- ------ ----------------------------------- ------------------------------------------------------------------------
222 1.3.5      1.5.0  ``Xapian::PostingSource`` public    Use the respective getter and setter methods instead, added in 1.3.5 and
223                   variables                           1.2.23.
224 ---------- ------ ----------------------------------- ------------------------------------------------------------------------
225 1.3.6      1.5.0  Subclassing |VRP|                   Subclass ``Xapian::RangeProcessor`` instead, and return a
226                                                       ``Xapian::Query`` from ``operator()()``.
227 ---------- ------ ----------------------------------- ------------------------------------------------------------------------
228 1.3.6      1.5.0  Subclassing |DateVRP|               Subclass ``Xapian::DateRangeProcessor`` instead, and return a
229                                                       ``Xapian::Query`` from ``operator()()``.
230 ---------- ------ ----------------------------------- ------------------------------------------------------------------------
231 1.3.6      1.5.0  Subclassing |NumberVRP|             Subclass ``Xapian::NumberRangeProcessor`` instead, and return a
232                                                       ``Xapian::Query`` from ``operator()()``.
233 ---------- ------ ----------------------------------- ------------------------------------------------------------------------
234 1.3.6      1.5.0  Subclassing |StringVRP|             Subclass ``Xapian::RangeProcessor`` instead (which includes equivalent
235                                                       support for prefix/suffix checking), and return a ``Xapian::Query`` from
236                                                       ``operator()()``.
237 ---------- ------ ----------------------------------- ------------------------------------------------------------------------
238 1.3.6      1.5.0  |add_valuerangeprocessor|           Use ``Xapian::QueryParser::add_rangeprocessor()`` instead, with a
239                                                       ``Xapian::RangeProcessor`` object instead of a |VRP| object.
240 ========== ====== =================================== ========================================================================
242 Bindings
243 --------
245 .. Keep table width to <= 126 columns.
247 ========== ====== ======== ============================ ======================================================================
248 Deprecated Remove Language Feature name                 Upgrade suggestion and comments
249 ========== ====== ======== ============================ ======================================================================
250 1.2.5      1.5.0  Python   MSet.items                   Iterate the MSet object itself instead.
251 ---------- ------ -------- ---------------------------- ----------------------------------------------------------------------
252 1.2.5      1.5.0  Python   ESet.items                   Iterate the ESet object itself instead.
253 ========== ====== ======== ============================ ======================================================================
255 Omega
256 -----
258 .. Keep table width to <= 126 columns.
260 ========== ====== =================================== ========================================================================
261 Deprecated Remove Feature name                        Upgrade suggestion and comments
262 ========== ====== =================================== ========================================================================
263 1.2.5      1.5.0  $set{spelling,true}                 Use $set{flag_spelling_suggestion,true} instead.
264 ========== ====== =================================== ========================================================================
266 .. Features currently marked as experimental
267 .. =========================================
268 .. Native C++ API
269 .. --------------
270 .. ============== ===============================================================================================================
271 .. Name           Details
272 .. ============== ===============================================================================================================
273 .. -------------- ---------------------------------------------------------------------------------------------------------------
274 .. ============== ===============================================================================================================
276 Features removed from Xapian
277 ============================
279 Native C++ API
280 --------------
282 .. Keep table width to <= 126 columns.
284 ======= =================================== ==================================================================================
285 Removed Feature name                        Upgrade suggestion and comments
286 ======= =================================== ==================================================================================
287 1.0.0   QueryParser::set_stemming_options() Use ``set_stemmer()``, ``set_stemming_strategy()`` and/or ``set_stopper()``
288                                             instead:
290                                             - ``set_stemming_options("")`` becomes
291                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_NONE)``
293                                             - ``set_stemming_options("none")`` becomes
294                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_NONE)``
296                                             - ``set_stemming_options(LANG)`` becomes
297                                               ``set_stemmer(Xapian::Stem(LANG)`` and
298                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_SOME)``
300                                             - ``set_stemming_options(LANG, false)`` becomes
301                                               ``set_stemmer(Xapian::Stem(LANG)`` and
302                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_SOME)``
304                                             - ``set_stemming_options(LANG, true)`` becomes
305                                               ``set_stemmer(Xapian::Stem(LANG)`` and
306                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_ALL)``
308                                             If a third parameter is passed, ``set_stopper(PARAM3)`` and treat the first two
309                                             parameters as above.
310 ------- ----------------------------------- ----------------------------------------------------------------------------------
311 1.0.0   Enquire::set_sort_forward()         Use ``Enquire::set_docid_order()`` instead:
313                                              - ``set_sort_forward(true)`` becomes ``set_docid_order(ASCENDING)``
314                                              - ``set_sort_forward(false)`` becomes ``set_docid_order(DESCENDING)``
315 ------- ----------------------------------- ----------------------------------------------------------------------------------
316 1.0.0   Enquire::set_sorting()              Use ``Enquire::set_sort_by_relevance()``, ``Enquire::set_sort_by_value()``, or
317                                             ``Enquire::set_sort_by_value_then_relevance()`` instead.
319                                              - ``set_sorting(KEY, 1)`` becomes ``set_sort_by_value(KEY)``
320                                              - ``set_sorting(KEY, 1, false)`` becomes ``set_sort_by_value(KEY)``
321                                              - ``set_sorting(KEY, 1, true)`` becomes ``set_sort_by_value_then_relevance(KEY)``
322                                              - ``set_sorting(ANYTHING, 0)`` becomes ``set_sort_by_relevance()``
323                                              - ``set_sorting(Xapian::BAD_VALUENO, ANYTHING)`` becomes
324                                                ``set_sort_by_relevance()``
325 ------- ----------------------------------- ----------------------------------------------------------------------------------
326 1.0.0   Stem::stem_word(word)               Use ``Stem::operator()(word)`` instead.
327 ------- ----------------------------------- ----------------------------------------------------------------------------------
328 1.0.0   Auto::open(path)                    Use the ``Database(path)`` constructor instead.
329 ------- ----------------------------------- ----------------------------------------------------------------------------------
330 1.0.0   Auto::open(path, action)            Use the ``WritableDatabase(path, action)`` constructor instead.
331 ------- ----------------------------------- ----------------------------------------------------------------------------------
332 1.0.0   Query::is_empty()                   Use ``Query::empty()`` instead.
333 ------- ----------------------------------- ----------------------------------------------------------------------------------
334 1.0.0   Document::add_term_nopos()          Use ``Document::add_term()`` instead.
335 ------- ----------------------------------- ----------------------------------------------------------------------------------
336 1.0.0   Enquire::set_bias()                 Use ``PostingSource`` instead (new in 1.2).
337 ------- ----------------------------------- ----------------------------------------------------------------------------------
338 1.0.0   ExpandDecider::operator()           Return type is now ``bool`` not ``int``.
339 ------- ----------------------------------- ----------------------------------------------------------------------------------
340 1.0.0   MatchDecider::operator()            Return type is now ``bool`` not ``int``.
341 ------- ----------------------------------- ----------------------------------------------------------------------------------
342 1.0.0   Error::get_type()                   Return type is now ``const char *`` not ``std::string``.  Most existing code
343                                             won't need changes, but if it does the simplest fix is to write
344                                             ``std::string(e.get_type())`` instead of ``e.get_type()``.
345 ------- ----------------------------------- ----------------------------------------------------------------------------------
346 1.0.0   <xapian/output.h>                   Use ``cout << obj.get_description();`` instead of ``cout << obj;``
347 ------- ----------------------------------- ----------------------------------------------------------------------------------
348 1.0.0   Several constructors marked         Explicitly create the object type required, for example use
349         as explicit.                        ``Xapian::Enquire enq(Xapian::Database(path));`` instead of
350                                             ``Xapian::Enquire enq(path);``
351 ------- ----------------------------------- ----------------------------------------------------------------------------------
352 1.0.0   QueryParser::parse_query() throwing Catch ``Xapian::QueryParserError`` instead of ``const char *``, and call
353         ``const char *`` exception.         ``get_msg()`` on the caught object.  If you need to build with either version,
354                                             catch both (you'll need to compile the part which catches ``QueryParserError``
355                                             conditionally, since this exception isn't present in the 0.9 release series).
356 ------- ----------------------------------- ----------------------------------------------------------------------------------
357 1.1.0   xapian_version_string()             Use ``version_string()`` instead.
358 ------- ----------------------------------- ----------------------------------------------------------------------------------
359 1.1.0   xapian_major_version()              Use ``major_version()`` instead.
360 ------- ----------------------------------- ----------------------------------------------------------------------------------
361 1.1.0   xapian_minor_version()              Use ``minor_version()`` instead.
362 ------- ----------------------------------- ----------------------------------------------------------------------------------
363 1.1.0   xapian_revision()                   Use ``revision()`` instead.
364 ------- ----------------------------------- ----------------------------------------------------------------------------------
365 1.1.0   Enquire::include_query_terms        Use ``Enquire::INCLUDE_QUERY_TERMS`` instead.
366 ------- ----------------------------------- ----------------------------------------------------------------------------------
367 1.1.0   Enquire::use_exact_termfreq         Use ``Enquire::USE_EXACT_TERMFREQ`` instead.
368 ------- ----------------------------------- ----------------------------------------------------------------------------------
369 1.1.0   Error::get_errno()                  Use ``Error::get_error_string()`` instead.
370 ------- ----------------------------------- ----------------------------------------------------------------------------------
371 1.1.0   Enquire::register_match_decider()   This method didn't do anything, so just remove calls to it!
372 ------- ----------------------------------- ----------------------------------------------------------------------------------
373 1.1.0   Query::Query(Query::op, Query)      This constructor isn't useful for any currently implemented
374                                             ``Query::op``.
375 ------- ----------------------------------- ----------------------------------------------------------------------------------
376 1.1.0   The Quartz backend                  Use the Chert backend instead.
377 ------- ----------------------------------- ----------------------------------------------------------------------------------
378 1.1.0   Quartz::open()                      Use ``Chert::open()`` instead.
379 ------- ----------------------------------- ----------------------------------------------------------------------------------
380 1.1.0   quartzcheck                         Use ``xapian-check`` instead.
381 ------- ----------------------------------- ----------------------------------------------------------------------------------
382 1.1.0   quartzcompact                       Use ``xapian-compact`` instead.
383 ------- ----------------------------------- ----------------------------------------------------------------------------------
384 1.1.0   quartzdump                          Use ``xapian-inspect`` instead.
385 ------- ----------------------------------- ----------------------------------------------------------------------------------
386 1.1.0   configure --enable-debug            configure --enable-assertions
387 ------- ----------------------------------- ----------------------------------------------------------------------------------
388 1.1.0   configure --enable-debug=full       configure --enable-assertions --enable-log
389 ------- ----------------------------------- ----------------------------------------------------------------------------------
390 1.1.0   configure --enable-debug=partial    configure --enable-assertions=partial
391 ------- ----------------------------------- ----------------------------------------------------------------------------------
392 1.1.0   configure --enable-debug=profile    configure --enable-log=profile
393 ------- ----------------------------------- ----------------------------------------------------------------------------------
394 1.1.0   configure --enable-debug-verbose    configure --enable-log
395 ------- ----------------------------------- ----------------------------------------------------------------------------------
396 1.1.0   ``Database::positionlist_begin()``  This check is quite expensive, and often you don't care.  If you
397         throwing ``RangeError`` if the      do it's easy to check - just open a ``TermListIterator`` for the
398         term specified doesn't index the    document and use ``skip_to()`` to check if the term is there.
399         document specified.
400 ------- ----------------------------------- ----------------------------------------------------------------------------------
401 1.1.0   ``Database::positionlist_begin()``  This check is quite expensive, and often you don't care.  If you
402         throwing ``DocNotFoundError`` if    do, it's easy to check - just call ``Database::get_document()`` with the
403         the document specified doesn't      specified document ID.
404         exist.
405 ------- ----------------------------------- ----------------------------------------------------------------------------------
406 1.1.5   delve -k                            Accepted as an undocumented alias for -V since 0.9.10 for compatibility with 0.9.9
407                                             and earlier.  Just use -V instead.
408 ------- ----------------------------------- ----------------------------------------------------------------------------------
409 1.3.0   The Flint backend                   Use the Chert backend instead.
410 ------- ----------------------------------- ----------------------------------------------------------------------------------
411 1.3.0   Flint::open()                       Use ``Chert::open()`` instead.
412 ------- ----------------------------------- ----------------------------------------------------------------------------------
413 1.3.0   xapian-chert-update                 Install Xapian 1.2.x (where x >= 5) to update chert databases from 1.1.3 and
414                                             earlier.
415 ------- ----------------------------------- ----------------------------------------------------------------------------------
416 1.3.0   Default second parameter to         The parameter name was ``ascending`` and defaulted to ``true``.  However
417         ``Enquire`` sorting functions.      ascending=false gave what you'd expect the default sort order to be (and probably
418                                             think of as ascending) while ascending=true gave the reverse (descending) order.
419                                             For sanity, we renamed the parameter to ``reverse`` and deprecated the default
420                                             value.  In the more distant future, we'll probably add a default again, but of
421                                             ``false`` instead.
423                                             The methods affected are:
424                                             ``Enquire::set_sort_by_value(Xapian::valueno sort_key)``
425                                             ``Enquire::set_sort_by_key(Xapian::Sorter * sorter)``
426                                             ``Enquire::set_sort_by_value_then_relevance(Xapian::valueno sort_key)``
427                                             ``Enquire::set_sort_by_key_then_relevance(Xapian::Sorter * sorter)``
428                                             ``Enquire::set_sort_by_relevance_then_value(Xapian::valueno sort_key)``
429                                             ``Enquire::set_sort_by_relevance_then_key(Xapian::Sorter * sorter)``
431                                             To update them, just add a second parameter with value ``true`` to each of the
432                                             above calls.  For the methods which take a ``Xapian::Sorter`` object, you'll also
433                                             need to migrate to ``Xapian::KeyMaker`` (see below).
434 ------- ----------------------------------- ----------------------------------------------------------------------------------
435 1.3.0   ``Sorter`` abstract base class.     Use ``KeyMaker`` class instead, which has the same semantics, but has been renamed
436                                             to indicate that the keys produced may be used for purposes other than sorting (we
437                                             plan to allow collapsing on generated keys in the future).
438 ------- ----------------------------------- ----------------------------------------------------------------------------------
439 1.3.0   ``MultiValueSorter`` class.         Use ``MultiValueKeyMaker`` class instead.  Note that ``MultiValueSorter::add()``
440                                             becomes ``MultiValueKeyMaker::add_value()``, but the sense of the direction flag
441                                             is reversed (to be consistent with ``Enquire::set_sort_by_value()``), so::
443                                                 MultiValueSorter sorter;
444                                                 // Primary ordering is forwards on value 4.
445                                                 sorter.add(4);
446                                                 // Secondary ordering is reverse on value 5.
447                                                 sorter.add(5, false);
449                                             becomes::
451                                                 MultiValueKeyMaker sorter;
452                                                 // Primary ordering is forwards on value 4.
453                                                 sorter.add_value(4);
454                                                 // Secondary ordering is reverse on value 5.
455                                                 sorter.add_value(5, true);
456 ------- ----------------------------------- ----------------------------------------------------------------------------------
457 1.3.0   ``matchspy`` parameter to           Use the newer ``MatchSpy`` class and ``Enquire::add_matchspy()`` method instead.
458         ``Enquire::get_mset()``
459 ------- ----------------------------------- ----------------------------------------------------------------------------------
460 1.3.0   ``Xapian::timeout`` typedef         Use ``unsigned`` instead, which should also work with older Xapian releases.
461 ------- ----------------------------------- ----------------------------------------------------------------------------------
462 1.3.0   ``Xapian::percent`` typedef         Use ``int`` instead, which should also work with older Xapian releases.
463 ------- ----------------------------------- ----------------------------------------------------------------------------------
464 1.3.0   ``Xapian::weight`` typedef          Use ``double`` instead, which should also work with older Xapian releases.
465 ------- ----------------------------------- ----------------------------------------------------------------------------------
466 1.3.0   ``Xapian::Query::unserialise()``    To be compatible with older and newer Xapian, you can catch both exceptions.
467         throws
468         ``Xapian::SerialisationError`` not
469         ``Xapian::InvalidArgumentError``
470         for errors in serialised data
471 ------- ----------------------------------- ----------------------------------------------------------------------------------
472 1.3.2   The Brass backend                   Use the Glass backend instead.
473 ------- ----------------------------------- ----------------------------------------------------------------------------------
474 1.3.2   ``Xapian::Brass::open()``           Use the constructor with ``Xapian::DB_BACKEND_GLASS`` flag (new in 1.3.2) instead.
475 ------- ----------------------------------- ----------------------------------------------------------------------------------
476 1.3.4   Copy constructors and assignment    We think it was a mistake that implicit copy constructors and assignment operators
477         operators for classes:              were being provided for these functor classes - it's hard to use them correctly,
478         ``Xapian::ExpandDecider``,          but easy to use them in ways which compile but don't work correctly, and we doubt
479         ``Xapian::FieldProcessor`` (new in  anyone is intentionally using them, so we've simply removed them.  For more
480         1.3.1), ``Xapian::KeyMaker``,       information, see https://trac.xapian.org/ticket/681
481         ``Xapian::MatchDecider``,
482         ``Xapian::StemImplementation``,
483         ``Xapian::Stopper`` and
484         ``Xapian::ValueRangeProcessor``.
485 ------- ----------------------------------- ----------------------------------------------------------------------------------
486 1.3.5   ``Xapian::DBCHECK_SHOW_BITMAP``     Use ``Xapian::DBCHECK_SHOW_FREELIST`` (added in 1.3.2) instead.
487                                             ``Xapian::DBCHECK_SHOW_BITMAP`` was added in 1.3.0, so has never been in a stable
488                                             release.
489 ------- ----------------------------------- ----------------------------------------------------------------------------------
490 1.5.0   The Chert backend                   Use the Glass backend instead.
491 ------- ----------------------------------- ----------------------------------------------------------------------------------
492 1.5.0   ``Xapian::Auto::open_stub()``       Use the constructor with ``Xapian::DB_BACKEND_STUB`` flag (new in 1.3.2) instead.
493 ------- ----------------------------------- ----------------------------------------------------------------------------------
494 1.5.0   ``Xapian::Chert::open()``           Use the constructor with ``Xapian::DB_BACKEND_GLASS`` flag (new in 1.3.2) instead.
495 ------- ----------------------------------- ----------------------------------------------------------------------------------
496 1.5.0   ``Xapian::InMemory::open()``        Use the constructor with ``Xapian::DB_BACKEND_INMEMORY`` flag (new in
497                                             1.3.5) instead.
498 ------- ----------------------------------- ----------------------------------------------------------------------------------
499 1.5.0   |flush|                             Use ``Xapian::WritableDatabase::commit()`` instead (available since 1.1.0).
500 ------- ----------------------------------- ----------------------------------------------------------------------------------
501 1.5.0   |set_max_wildcard_expansion|        Use ``Xapian::QueryParser::set_max_expansion()`` instead.  The exact equivalent of
502                                             ``set_max_wildcard_expansion(n)`` is
503                                             ``set_max_expansion(n, Xapian::Query::WILDCARD_LIMIT_ERROR,
504                                             Xapian::QueryParser::FLAG_WILDCARD)``
505 ------- ----------------------------------- ----------------------------------------------------------------------------------
506 1.5.0   ``Xapian::Compactor`` methods       Use the ``Xapian::Database::compact()`` method instead.  The
507         ``set_block_size()``,               ``Xapian::Compactor`` class is now just a subclassable functor class to
508         ``set_renumber()``,                 allow access to progress messages and control over merging of user
509         ``set_multipass()``,                metadata.
510         ``set_compaction_level()``,
511         ``set_destdir()``, ``add_source()`
512         and ``compact()``.
513 ======= =================================== ==================================================================================
516 Bindings
517 --------
519 .. Keep table width to <= 126 columns.
521 ======= ======== ============================ ================================================================================
522 Removed Language Feature name                 Upgrade suggestion and comments
523 ======= ======== ============================ ================================================================================
524 1.0.0   SWIG     Enquire::set_sort_forward()  Use ``Enquire::set_docid_order()`` instead.
525         [#rswg]_
526                                                 - ``set_sort_forward(true)`` becomes ``set_docid_order(ASCENDING)``
527                                                 - ``set_sort_forward(false)`` becomes ``set_docid_order(DESCENDING)``
528 ------- -------- ---------------------------- --------------------------------------------------------------------------------
529 1.0.0   SWIG     Enquire::set_sorting()       Use ``Enquire::set_sort_by_relevance()``, ``Enquire::set_sort_by_value()``
530         [#rswg]_                              or ``Enquire::set_sort_by_value_then_relevance()`` instead.
532                                                - ``set_sorting(KEY, 1)`` becomes ``set_sort_by_value(KEY)``
533                                                - ``set_sorting(KEY, 1, false) becomes ``set_sort_by_value(KEY)``
534                                                - ``set_sorting(KEY, 1, true)`` becomes
535                                                  ``set_sort_by_value_then_relevance(KEY)``
536                                                - ``set_sorting(ANYTHING, 0) becomes set_sort_by_relevance()``
537                                                - ``set_sorting(Xapian::BAD_VALUENO, ANYTHING)`` becomes
538                                                  ``set_sort_by_relevance()``
539 ------- -------- ---------------------------- --------------------------------------------------------------------------------
540 1.0.0   SWIG     Auto::open(path)             Use the ``Database(path)`` constructor instead.
541         [#rswg]_
543 ------- -------- ---------------------------- --------------------------------------------------------------------------------
544 1.0.0   SWIG     Auto::open(path, action)     Use the ``WritableDatabase(path, action)`` constructor instead.
545         [#rswg]_
546 ------- -------- ---------------------------- --------------------------------------------------------------------------------
547 1.0.0   SWIG     MSet::is_empty()             Use ``MSet::empty()`` instead.
548         [#rsw3]_
549 ------- -------- ---------------------------- --------------------------------------------------------------------------------
550 1.0.0   SWIG     ESet::is_empty()             Use ``ESet::empty()`` instead.
551         [#rsw3]_
552 ------- -------- ---------------------------- --------------------------------------------------------------------------------
553 1.0.0   SWIG     RSet::is_empty()             Use ``RSet::empty()`` instead.
554         [#rsw3]_
555 ------- -------- ---------------------------- --------------------------------------------------------------------------------
556 1.0.0   SWIG     Query::is_empty()            Use ``Query::empty()`` instead.
557         [#rsw3]_
558 ------- -------- ---------------------------- --------------------------------------------------------------------------------
559 1.0.0   SWIG     Document::add_term_nopos()   Use ``Document::add_term()`` instead.
560         [#rswg]_
561 ------- -------- ---------------------------- --------------------------------------------------------------------------------
562 1.0.0   CSharp   ExpandDecider::Apply()       Return type is now ``bool`` instead of ``int``.
563 ------- -------- ---------------------------- --------------------------------------------------------------------------------
564 1.0.0   CSharp   MatchDecider::Apply()        Return type is now ``bool`` instead of ``int``.
565 ------- -------- ---------------------------- --------------------------------------------------------------------------------
566 1.0.0   SWIG     Stem::stem_word(word)        Use ``Stem::operator()(word)`` instead. [#callable]_
567         [#rswg]_
568 ------- -------- ---------------------------- --------------------------------------------------------------------------------
569 1.1.0   SWIG     xapian_version_string()      Use ``version_string()`` instead.
570         [#rswg]_
571 ------- -------- ---------------------------- --------------------------------------------------------------------------------
572 1.1.0   SWIG     xapian_major_version()       Use ``major_version()`` instead.
573         [#rswg]_
574 ------- -------- ---------------------------- --------------------------------------------------------------------------------
575 1.1.0   SWIG     xapian_minor_version()       Use ``minor_version()`` instead.
576         [#rswg]_
577 ------- -------- ---------------------------- --------------------------------------------------------------------------------
578 1.1.0   SWIG     xapian_revision()            Use ``revision()`` instead.
579         [#rswg]_
580 ------- -------- ---------------------------- --------------------------------------------------------------------------------
581 1.1.0   SWIG     ESetIterator::get_termname() Use ``ESetIterator::get_term()`` instead.  This change is intended to
582         [#rswg]_                              bring the ESet iterators in line with other term iterators, which all
583                                               support ``get_term()`` instead of ``get_termname()``.
585 ------- -------- ---------------------------- --------------------------------------------------------------------------------
586 1.1.0   Python   get_description()            All ``get_description()`` methods have been renamed to ``__str__()``,
587                                               so the normal python ``str()`` function can be used.
588 ------- -------- ---------------------------- --------------------------------------------------------------------------------
589 1.1.0   Python   MSetItem.get_*()             All these methods are deprecated, in favour of properties.
590                                               To convert, just change ``msetitem.get_FOO()`` to ``msetitem.FOO``
591 ------- -------- ---------------------------- --------------------------------------------------------------------------------
592 1.1.0   Python   Enquire.get_matching_terms   Replaced by ``Enquire.matching_terms``, for consistency with
593                                               rest of Python API.  Note: an ``Enquire.get_matching_terms`` method existed in
594                                               releases up-to and including 1.2.4, but this was actually an old implementation
595                                               which only accepted a MSetIterator as a parameter, and would have failed with
596                                               code written expecting the version in 1.0.0.  It was fully removed after
597                                               release 1.2.4.
598 ------- -------- ---------------------------- --------------------------------------------------------------------------------
599 1.1.0   SWIG     Error::get_errno()           Use ``Error::get_error_string()`` instead.
600         [#rswg]_
601 ------- -------- ---------------------------- --------------------------------------------------------------------------------
602 1.1.0   SWIG     MSet::get_document_id()      Use ``MSet::get_docid()`` instead.
603         [#rsw2]_
604 ------- -------- ---------------------------- --------------------------------------------------------------------------------
605 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
606                                               point it no longer seemed worthwhile to reinstate it.  Please use the property
607                                               API instead, e.g. ``mset[i].docid``, ``mset[i].weight``, etc.
608 ------- -------- ---------------------------- --------------------------------------------------------------------------------
609 1.2.5   Python   if idx in mset               This was nominally implemented, but never actually worked.  Since nobody seems
610                                               to have noticed in 3.5 years, we just removed it.  If you have uses (which were
611                                               presumably never called), you can replace them with:
612                                               ``if idx >= 0 and idx < len(mset)``
613 ------- -------- ---------------------------- --------------------------------------------------------------------------------
614 1.3.0   Python   Non-pythonic iterators       Use the pythonic iterators instead.
615 ------- -------- ---------------------------- --------------------------------------------------------------------------------
616 1.3.0   Python   Stem_get_available_languages Use Stem.get_available_languages instead (static method instead of function)
617 ======= ======== ============================ ================================================================================
619 .. [#rswg] This affects all SWIG generated bindings (currently: Python, PHP, Ruby, Tcl8 and CSharp)
621 .. [#rsw2] This affects all SWIG-generated bindings except those for Ruby, support for which was added after the function was deprecated in Xapian-core.
623 .. [#rsw3] 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").
625 .. [#callable] 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.
627 Omega
628 -----
630 .. Keep table width to <= 126 columns.
632 ======= =================================== ==================================================================================
633 Removed Feature name                        Upgrade suggestion and comments
634 ======= =================================== ==================================================================================
635 1.0.0   $freqs                              Use ``$map{$queryterms,$_:&nbsp;$nice{$freq{$_}}}`` instead.
636 ------- ----------------------------------- ----------------------------------------------------------------------------------
637 1.0.0   scriptindex -u                      ``-u`` was ignored for compatibility with 0.7.5 and earlier, so just remove it.
638 ------- ----------------------------------- ----------------------------------------------------------------------------------
639 1.0.0   scriptindex -q                      ``-q`` was ignored for compatibility with 0.6.1 and earlier, so just remove it.
640 ------- ----------------------------------- ----------------------------------------------------------------------------------
641 1.1.0   scriptindex index=nopos             Use ``indexnopos`` instead.
642 ------- ----------------------------------- ----------------------------------------------------------------------------------
643 1.3.0   ``OLDP`` CGI parameter              Use ``xP`` CGI parameter instead (direct replacement), which has been supported
644                                             since at least 0.5.0.
645 ------- ----------------------------------- ----------------------------------------------------------------------------------
646 1.5.0   omindex command line long option    Renamed to ``--no-delete``, which works in 1.2.4 and later.
647         ``--preserve-nonduplicates``.
648 ======= =================================== ==================================================================================