Add deprecation of various Compactor methods
[xapian.git] / xapian-core / docs / deprecation.rst
blobc3c5eab30b8998ab87601ff728d49e7b77e17b28
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 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 .. Keep table width to <= 126 columns.
201 ========== ====== =================================== ========================================================================
202 Deprecated Remove Feature name                        Upgrade suggestion and comments
203 ========== ====== =================================== ========================================================================
204 1.1.0      ?      Xapian::WritableDatabase::flush()   Xapian::WritableDatabase::commit() should be used instead.
205 ========== ====== =================================== ========================================================================
207 .. flush() is just a simple inlined alias, so perhaps not worth causing pain by
208 .. removing it in a hurry, though it would be nice to be able to reuse the
209 .. method name to actually implement a flush() which writes out data but
210 .. doesn't commit.
212 Bindings
213 --------
215 .. Keep table width to <= 126 columns.
217 ========== ====== ======== ============================ ======================================================================
218 Deprecated Remove Language Feature name                 Upgrade suggestion and comments
219 ========== ====== ======== ============================ ======================================================================
220 1.2.5      1.5.0  Python   MSet.items                   Iterate the MSet object itself instead.
221 ---------- ------ -------- ---------------------------- ----------------------------------------------------------------------
222 1.2.5      1.5.0  Python   ESet.items                   Iterate the ESet object itself instead.
223 ========== ====== ======== ============================ ======================================================================
225 Omega
226 -----
228 .. Keep table width to <= 126 columns.
230 ========== ====== =================================== ========================================================================
231 Deprecated Remove Feature name                        Upgrade suggestion and comments
232 ========== ====== =================================== ========================================================================
233 1.2.4      1.5.0  omindex command line long option    Renamed to ``--no-delete``, which works in 1.2.4 and later.
234                   ``--preserve-nonduplicates``.
235 ---------- ------ ----------------------------------- ------------------------------------------------------------------------
236 1.2.5      1.5.0  $set{spelling,true}                 Use $set{flag_spelling_suggestion,true} instead.
237 ========== ====== =================================== ========================================================================
239 .. Features currently marked as experimental
240 .. =========================================
241 .. Native C++ API
242 .. --------------
243 .. ============== ===============================================================================================================
244 .. Name           Details
245 .. ============== ===============================================================================================================
246 .. -------------- ---------------------------------------------------------------------------------------------------------------
247 .. ============== ===============================================================================================================
249 Features removed from Xapian
250 ============================
252 Native C++ API
253 --------------
255 .. Keep table width to <= 126 columns.
257 .. Substitution definitions for feature names which are two wide for the column:
259 .. |set_max_wildcard_expansion| replace:: ``Xapian::QueryParser::set_max_wildcard_expansion()``
261 ======= =================================== ==================================================================================
262 Removed Feature name                        Upgrade suggestion and comments
263 ======= =================================== ==================================================================================
264 1.0.0   QueryParser::set_stemming_options() Use ``set_stemmer()``, ``set_stemming_strategy()`` and/or ``set_stopper()``
265                                             instead:
267                                             - ``set_stemming_options("")`` becomes
268                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_NONE)``
270                                             - ``set_stemming_options("none")`` becomes
271                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_NONE)``
273                                             - ``set_stemming_options(LANG)`` becomes
274                                               ``set_stemmer(Xapian::Stem(LANG)`` and
275                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_SOME)``
277                                             - ``set_stemming_options(LANG, false)`` becomes
278                                               ``set_stemmer(Xapian::Stem(LANG)`` and
279                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_SOME)``
281                                             - ``set_stemming_options(LANG, true)`` becomes
282                                               ``set_stemmer(Xapian::Stem(LANG)`` and
283                                               ``set_stemming_strategy(Xapian::QueryParser::STEM_ALL)``
285                                             If a third parameter is passed, ``set_stopper(PARAM3)`` and treat the first two
286                                             parameters as above.
287 ------- ----------------------------------- ----------------------------------------------------------------------------------
288 1.0.0   Enquire::set_sort_forward()         Use ``Enquire::set_docid_order()`` instead:
290                                              - ``set_sort_forward(true)`` becomes ``set_docid_order(ASCENDING)``
291                                              - ``set_sort_forward(false)`` becomes ``set_docid_order(DESCENDING)``
292 ------- ----------------------------------- ----------------------------------------------------------------------------------
293 1.0.0   Enquire::set_sorting()              Use ``Enquire::set_sort_by_relevance()``, ``Enquire::set_sort_by_value()``, or
294                                             ``Enquire::set_sort_by_value_then_relevance()`` instead.
296                                              - ``set_sorting(KEY, 1)`` becomes ``set_sort_by_value(KEY)``
297                                              - ``set_sorting(KEY, 1, false)`` becomes ``set_sort_by_value(KEY)``
298                                              - ``set_sorting(KEY, 1, true)`` becomes ``set_sort_by_value_then_relevance(KEY)``
299                                              - ``set_sorting(ANYTHING, 0)`` becomes ``set_sort_by_relevance()``
300                                              - ``set_sorting(Xapian::BAD_VALUENO, ANYTHING)`` becomes
301                                                ``set_sort_by_relevance()``
302 ------- ----------------------------------- ----------------------------------------------------------------------------------
303 1.0.0   Stem::stem_word(word)               Use ``Stem::operator()(word)`` instead.
304 ------- ----------------------------------- ----------------------------------------------------------------------------------
305 1.0.0   Auto::open(path)                    Use the ``Database(path)`` constructor instead.
306 ------- ----------------------------------- ----------------------------------------------------------------------------------
307 1.0.0   Auto::open(path, action)            Use the ``WritableDatabase(path, action)`` constructor instead.
308 ------- ----------------------------------- ----------------------------------------------------------------------------------
309 1.0.0   Query::is_empty()                   Use ``Query::empty()`` instead.
310 ------- ----------------------------------- ----------------------------------------------------------------------------------
311 1.0.0   Document::add_term_nopos()          Use ``Document::add_term()`` instead.
312 ------- ----------------------------------- ----------------------------------------------------------------------------------
313 1.0.0   Enquire::set_bias()                 Use ``PostingSource`` instead (new in 1.2).
314 ------- ----------------------------------- ----------------------------------------------------------------------------------
315 1.0.0   ExpandDecider::operator()           Return type is now ``bool`` not ``int``.
316 ------- ----------------------------------- ----------------------------------------------------------------------------------
317 1.0.0   MatchDecider::operator()            Return type is now ``bool`` not ``int``.
318 ------- ----------------------------------- ----------------------------------------------------------------------------------
319 1.0.0   Error::get_type()                   Return type is now ``const char *`` not ``std::string``.  Most existing code
320                                             won't need changes, but if it does the simplest fix is to write
321                                             ``std::string(e.get_type())`` instead of ``e.get_type()``.
322 ------- ----------------------------------- ----------------------------------------------------------------------------------
323 1.0.0   <xapian/output.h>                   Use ``cout << obj.get_description();`` instead of ``cout << obj;``
324 ------- ----------------------------------- ----------------------------------------------------------------------------------
325 1.0.0   Several constructors marked         Explicitly create the object type required, for example use
326         as explicit.                        ``Xapian::Enquire enq(Xapian::Database(path));`` instead of
327                                             ``Xapian::Enquire enq(path);``
328 ------- ----------------------------------- ----------------------------------------------------------------------------------
329 1.0.0   QueryParser::parse_query() throwing Catch ``Xapian::QueryParserError`` instead of ``const char *``, and call
330         ``const char *`` exception.         ``get_msg()`` on the caught object.  If you need to build with either version,
331                                             catch both (you'll need to compile the part which catches ``QueryParserError``
332                                             conditionally, since this exception isn't present in the 0.9 release series).
333 ------- ----------------------------------- ----------------------------------------------------------------------------------
334 1.1.0   xapian_version_string()             Use ``version_string()`` instead.
335 ------- ----------------------------------- ----------------------------------------------------------------------------------
336 1.1.0   xapian_major_version()              Use ``major_version()`` instead.
337 ------- ----------------------------------- ----------------------------------------------------------------------------------
338 1.1.0   xapian_minor_version()              Use ``minor_version()`` instead.
339 ------- ----------------------------------- ----------------------------------------------------------------------------------
340 1.1.0   xapian_revision()                   Use ``revision()`` instead.
341 ------- ----------------------------------- ----------------------------------------------------------------------------------
342 1.1.0   Enquire::include_query_terms        Use ``Enquire::INCLUDE_QUERY_TERMS`` instead.
343 ------- ----------------------------------- ----------------------------------------------------------------------------------
344 1.1.0   Enquire::use_exact_termfreq         Use ``Enquire::USE_EXACT_TERMFREQ`` instead.
345 ------- ----------------------------------- ----------------------------------------------------------------------------------
346 1.1.0   Error::get_errno()                  Use ``Error::get_error_string()`` instead.
347 ------- ----------------------------------- ----------------------------------------------------------------------------------
348 1.1.0   Enquire::register_match_decider()   This method didn't do anything, so just remove calls to it!
349 ------- ----------------------------------- ----------------------------------------------------------------------------------
350 1.1.0   Query::Query(Query::op, Query)      This constructor isn't useful for any currently implemented
351                                             ``Query::op``.
352 ------- ----------------------------------- ----------------------------------------------------------------------------------
353 1.1.0   The Quartz backend                  Use the Chert backend instead.
354 ------- ----------------------------------- ----------------------------------------------------------------------------------
355 1.1.0   Quartz::open()                      Use ``Chert::open()`` instead.
356 ------- ----------------------------------- ----------------------------------------------------------------------------------
357 1.1.0   quartzcheck                         Use ``xapian-check`` instead.
358 ------- ----------------------------------- ----------------------------------------------------------------------------------
359 1.1.0   quartzcompact                       Use ``xapian-compact`` instead.
360 ------- ----------------------------------- ----------------------------------------------------------------------------------
361 1.1.0   quartzdump                          Use ``xapian-inspect`` instead.
362 ------- ----------------------------------- ----------------------------------------------------------------------------------
363 1.1.0   configure --enable-debug            configure --enable-assertions
364 ------- ----------------------------------- ----------------------------------------------------------------------------------
365 1.1.0   configure --enable-debug=full       configure --enable-assertions --enable-log
366 ------- ----------------------------------- ----------------------------------------------------------------------------------
367 1.1.0   configure --enable-debug=partial    configure --enable-assertions=partial
368 ------- ----------------------------------- ----------------------------------------------------------------------------------
369 1.1.0   configure --enable-debug=profile    configure --enable-log=profile
370 ------- ----------------------------------- ----------------------------------------------------------------------------------
371 1.1.0   configure --enable-debug-verbose    configure --enable-log
372 ------- ----------------------------------- ----------------------------------------------------------------------------------
373 1.1.0   ``Database::positionlist_begin()``  This check is quite expensive, and often you don't care.  If you
374         throwing ``RangeError`` if the      do it's easy to check - just open a ``TermListIterator`` for the
375         term specified doesn't index the    document and use ``skip_to()`` to check if the term is there.
376         document specified.
377 ------- ----------------------------------- ----------------------------------------------------------------------------------
378 1.1.0   ``Database::positionlist_begin()``  This check is quite expensive, and often you don't care.  If you
379         throwing ``DocNotFoundError`` if    do, it's easy to check - just call ``Database::get_document()`` with the
380         the document specified doesn't      specified document ID.
381         exist.
382 ------- ----------------------------------- ----------------------------------------------------------------------------------
383 1.1.5   delve -k                            Accepted as an undocumented alias for -V since 0.9.10 for compatibility with 0.9.9
384                                             and earlier.  Just use -V instead.
385 ------- ----------------------------------- ----------------------------------------------------------------------------------
386 1.3.0   The Flint backend                   Use the Chert backend instead.
387 ------- ----------------------------------- ----------------------------------------------------------------------------------
388 1.3.0   Flint::open()                       Use ``Chert::open()`` instead.
389 ------- ----------------------------------- ----------------------------------------------------------------------------------
390 1.3.0   xapian-chert-update                 Install Xapian 1.2.x (where x >= 5) to update chert databases from 1.1.3 and
391                                             earlier.
392 ------- ----------------------------------- ----------------------------------------------------------------------------------
393 1.3.0   Default second parameter to         The parameter name was ``ascending`` and defaulted to ``true``.  However
394         ``Enquire`` sorting functions.      ascending=false gave what you'd expect the default sort order to be (and probably
395                                             think of as ascending) while ascending=true gave the reverse (descending) order.
396                                             For sanity, we renamed the parameter to ``reverse`` and deprecated the default
397                                             value.  In the more distant future, we'll probably add a default again, but of
398                                             ``false`` instead.
400                                             The methods affected are:
401                                             ``Enquire::set_sort_by_value(Xapian::valueno sort_key)``
402                                             ``Enquire::set_sort_by_key(Xapian::Sorter * sorter)``
403                                             ``Enquire::set_sort_by_value_then_relevance(Xapian::valueno sort_key)``
404                                             ``Enquire::set_sort_by_key_then_relevance(Xapian::Sorter * sorter)``
405                                             ``Enquire::set_sort_by_relevance_then_value(Xapian::valueno sort_key)``
406                                             ``Enquire::set_sort_by_relevance_then_key(Xapian::Sorter * sorter)``
408                                             To update them, just add a second parameter with value ``true`` to each of the
409                                             above calls.  For the methods which take a ``Xapian::Sorter`` object, you'll also
410                                             need to migrate to ``Xapian::KeyMaker`` (see below).
411 ------- ----------------------------------- ----------------------------------------------------------------------------------
412 1.3.0   ``Sorter`` abstract base class.     Use ``KeyMaker`` class instead, which has the same semantics, but has been renamed
413                                             to indicate that the keys produced may be used for purposes other than sorting (we
414                                             plan to allow collapsing on generated keys in the future).
415 ------- ----------------------------------- ----------------------------------------------------------------------------------
416 1.3.0   ``MultiValueSorter`` class.         Use ``MultiValueKeyMaker`` class instead.  Note that ``MultiValueSorter::add()``
417                                             becomes ``MultiValueKeyMaker::add_value()``, but the sense of the direction flag
418                                             is reversed (to be consistent with ``Enquire::set_sort_by_value()``), so::
420                                                 MultiValueSorter sorter;
421                                                 // Primary ordering is forwards on value 4.
422                                                 sorter.add(4);
423                                                 // Secondary ordering is reverse on value 5.
424                                                 sorter.add(5, false);
426                                             becomes::
428                                                 MultiValueKeyMaker sorter;
429                                                 // Primary ordering is forwards on value 4.
430                                                 sorter.add_value(4);
431                                                 // Secondary ordering is reverse on value 5.
432                                                 sorter.add_value(5, true);
433 ------- ----------------------------------- ----------------------------------------------------------------------------------
434 1.3.0   ``matchspy`` parameter to           Use the newer ``MatchSpy`` class and ``Enquire::add_matchspy()`` method instead.
435         ``Enquire::get_mset()``
436 ------- ----------------------------------- ----------------------------------------------------------------------------------
437 1.3.0   ``Xapian::timeout`` typedef         Use POSIX ``useconds_t`` (from ``<sys/types.h>``) instead, which should also work
438                                             with older Xapian releases.
439 ------- ----------------------------------- ----------------------------------------------------------------------------------
440 1.3.0   ``Xapian::percent`` typedef         Use ``int`` instead, which should also work with older Xapian releases.
441 ------- ----------------------------------- ----------------------------------------------------------------------------------
442 1.3.0   ``Xapian::weight`` typedef          Use ``double`` instead, which should also work with older Xapian releases.
443 ------- ----------------------------------- ----------------------------------------------------------------------------------
444 1.3.0   ``Xapian::Query::unserialise()``    To be compatible with older and newer Xapian, you can catch both exceptions.
445         throws
446         ``Xapian::SerialisationError`` not
447         ``Xapian::InvalidArgumentError``
448         for errors in serialised data
449 ------- ----------------------------------- ----------------------------------------------------------------------------------
450 1.3.1   ``Xapian::ErrorHandler``            We feel the current ErrorHandler API doesn't work at the right level (it only
451                                             works in Enquire, whereas you should be able to handle errors at the Database
452                                             level too) and we can't find any evidence that people are actually using it.
453                                             So we are deprecating it and will replace it with something better thought out,
454                                             probably during the 1.3.x development series.  There's so further thoughts at
455                                             http://trac.xapian.org/ticket/3#comment:8
456 ------- ----------------------------------- ----------------------------------------------------------------------------------
457 1.3.2   ``Xapian::Auto::open_stub()``       Use the constructor with ``Xapian::DB_BACKEND_STUB`` flag (new in 1.3.2) instead.
458 ------- ----------------------------------- ----------------------------------------------------------------------------------
459 1.3.2   ``Xapian::Chert::open()``           Use the constructor with ``Xapian::DB_BACKEND_CHERT`` flag (new in 1.3.2) instead.
460 ------- ----------------------------------- ----------------------------------------------------------------------------------
461 1.3.2   The Brass backend                   Use the Glass backend instead.
462 ------- ----------------------------------- ----------------------------------------------------------------------------------
463 1.3.2   ``Xapian::Brass::open()``           Use the constructor with ``Xapian::DB_BACKEND_GLASS`` flag (new in 1.3.2) instead.
464 ------- ----------------------------------- ----------------------------------------------------------------------------------
465 1.3.3   |set_max_wildcard_expansion|        Use ``Xapian::QueryParser::set_max_expansion()`` instead.
466 ------- ----------------------------------- ----------------------------------------------------------------------------------
467 1.3.4   Copy constructors and assignment    We think it was a mistake that implicit copy constructors and assignment operators
468         operators for classes:              were being provided for these functor classes - it's hard to use them correctly,
469         ``Xapian::ExpandDecider``,          but easy to use them in ways which compile but don't work correctly, and we doubt
470         ``Xapian::FieldProcessor`` (new in  anyone is intentionally using them, so we've simply removed them.  For more
471         1.3.1), ``Xapian::KeyMaker``,       information, see http://trac.xapian.org/ticket/681
472         ``Xapian::MatchDecider``,
473         ``Xapian::StemImplementation``,
474         ``Xapian::Stopper`` and
475         ``Xapian::ValueRangeProcessor``.
476 ------- ----------------------------------- ----------------------------------------------------------------------------------
477 1.3.4   ``Xapian::Compactor`` methods       Use the ``Xapian::Database::compact()`` method instead.  The ``Xapian::Compact``
478         ``set_block_size()``,               is now just a subclassable functor class to allow access to progress messages
479         ``set_renumber()``,                 and control over merging of user metadata.
480         ``set_multipass()``,
481         ``set_compaction_level()``,         The new API is also provided in xapian-core 1.2.22 and later.
482         ``set_destdir()``, ``add_source()`
483         and ``compact()``.
484 ======= =================================== ==================================================================================
487 Bindings
488 --------
490 .. Keep table width to <= 126 columns.
492 ======= ======== ============================ ================================================================================
493 Removed Language Feature name                 Upgrade suggestion and comments
494 ======= ======== ============================ ================================================================================
495 1.0.0   SWIG     Enquire::set_sort_forward()  Use ``Enquire::set_docid_order()`` instead.
496         [#rswg]_
497                                                 - ``set_sort_forward(true)`` becomes ``set_docid_order(ASCENDING)``
498                                                 - ``set_sort_forward(false)`` becomes ``set_docid_order(DESCENDING)``
499 ------- -------- ---------------------------- --------------------------------------------------------------------------------
500 1.0.0   SWIG     Enquire::set_sorting()       Use ``Enquire::set_sort_by_relevance()``, ``Enquire::set_sort_by_value()``
501         [#rswg]_                              or ``Enquire::set_sort_by_value_then_relevance()`` instead.
503                                                - ``set_sorting(KEY, 1)`` becomes ``set_sort_by_value(KEY)``
504                                                - ``set_sorting(KEY, 1, false) becomes ``set_sort_by_value(KEY)``
505                                                - ``set_sorting(KEY, 1, true)`` becomes
506                                                  ``set_sort_by_value_then_relevance(KEY)``
507                                                - ``set_sorting(ANYTHING, 0) becomes set_sort_by_relevance()``
508                                                - ``set_sorting(Xapian::BAD_VALUENO, ANYTHING)`` becomes
509                                                  ``set_sort_by_relevance()``
510 ------- -------- ---------------------------- --------------------------------------------------------------------------------
511 1.0.0   SWIG     Auto::open(path)             Use the ``Database(path)`` constructor instead.
512         [#rswg]_
514 ------- -------- ---------------------------- --------------------------------------------------------------------------------
515 1.0.0   SWIG     Auto::open(path, action)     Use the ``WritableDatabase(path, action)`` constructor instead.
516         [#rswg]_
517 ------- -------- ---------------------------- --------------------------------------------------------------------------------
518 1.0.0   SWIG     MSet::is_empty()             Use ``MSet::empty()`` instead.
519         [#rsw3]_
520 ------- -------- ---------------------------- --------------------------------------------------------------------------------
521 1.0.0   SWIG     ESet::is_empty()             Use ``ESet::empty()`` instead.
522         [#rsw3]_
523 ------- -------- ---------------------------- --------------------------------------------------------------------------------
524 1.0.0   SWIG     RSet::is_empty()             Use ``RSet::empty()`` instead.
525         [#rsw3]_
526 ------- -------- ---------------------------- --------------------------------------------------------------------------------
527 1.0.0   SWIG     Query::is_empty()            Use ``Query::empty()`` instead.
528         [#rsw3]_
529 ------- -------- ---------------------------- --------------------------------------------------------------------------------
530 1.0.0   SWIG     Document::add_term_nopos()   Use ``Document::add_term()`` instead.
531         [#rswg]_
532 ------- -------- ---------------------------- --------------------------------------------------------------------------------
533 1.0.0   CSharp   ExpandDecider::Apply()       Return type is now ``bool`` instead of ``int``.
534 ------- -------- ---------------------------- --------------------------------------------------------------------------------
535 1.0.0   CSharp   MatchDecider::Apply()        Return type is now ``bool`` instead of ``int``.
536 ------- -------- ---------------------------- --------------------------------------------------------------------------------
537 1.0.0   SWIG     Stem::stem_word(word)        Use ``Stem::operator()(word)`` instead. [#callable]_
538         [#rswg]_
539 ------- -------- ---------------------------- --------------------------------------------------------------------------------
540 1.1.0   SWIG     xapian_version_string()      Use ``version_string()`` instead.
541         [#rswg]_
542 ------- -------- ---------------------------- --------------------------------------------------------------------------------
543 1.1.0   SWIG     xapian_major_version()       Use ``major_version()`` instead.
544         [#rswg]_
545 ------- -------- ---------------------------- --------------------------------------------------------------------------------
546 1.1.0   SWIG     xapian_minor_version()       Use ``minor_version()`` instead.
547         [#rswg]_
548 ------- -------- ---------------------------- --------------------------------------------------------------------------------
549 1.1.0   SWIG     xapian_revision()            Use ``revision()`` instead.
550         [#rswg]_
551 ------- -------- ---------------------------- --------------------------------------------------------------------------------
552 1.1.0   SWIG     ESetIterator::get_termname() Use ``ESetIterator::get_term()`` instead.  This change is intended to
553         [#rswg]_                              bring the ESet iterators in line with other term iterators, which all
554                                               support ``get_term()`` instead of ``get_termname()``.
556 ------- -------- ---------------------------- --------------------------------------------------------------------------------
557 1.1.0   Python   get_description()            All ``get_description()`` methods have been renamed to ``__str__()``,
558                                               so the normal python ``str()`` function can be used.
559 ------- -------- ---------------------------- --------------------------------------------------------------------------------
560 1.1.0   Python   MSetItem.get_*()             All these methods are deprecated, in favour of properties.
561                                               To convert, just change ``msetitem.get_FOO()`` to ``msetitem.FOO``
562 ------- -------- ---------------------------- --------------------------------------------------------------------------------
563 1.1.0   Python   Enquire.get_matching_terms   Replaced by ``Enquire.matching_terms``, for consistency with
564                                               rest of Python API.  Note: an ``Enquire.get_matching_terms`` method existed in
565                                               releases up-to and including 1.2.4, but this was actually an old implementation
566                                               which only accepted a MSetIterator as a parameter, and would have failed with
567                                               code written expecting the version in 1.0.0.  It was fully removed after
568                                               release 1.2.4.
569 ------- -------- ---------------------------- --------------------------------------------------------------------------------
570 1.1.0   SWIG     Error::get_errno()           Use ``Error::get_error_string()`` instead.
571         [#rswg]_
572 ------- -------- ---------------------------- --------------------------------------------------------------------------------
573 1.1.0   SWIG     MSet::get_document_id()      Use ``MSet::get_docid()`` instead.
574         [#rsw2]_
575 ------- -------- ---------------------------- --------------------------------------------------------------------------------
576 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
577                                               point it no longer seemed worthwhile to reinstate it.  Please use the property
578                                               API instead, e.g. ``mset[i].docid``, ``mset[i].weight``, etc.
579 ------- -------- ---------------------------- --------------------------------------------------------------------------------
580 1.2.5   Python   if idx in mset               This was nominally implemented, but never actually worked.  Since nobody seems
581                                               to have noticed in 3.5 years, we just removed it.  If you have uses (which were
582                                               presumably never called), you can replace them with:
583                                               ``if idx >= 0 and idx < len(mset)``
584 ------- -------- ---------------------------- --------------------------------------------------------------------------------
585 1.3.0   Python   Non-pythonic iterators       Use the pythonic iterators instead.
586 ------- -------- ---------------------------- --------------------------------------------------------------------------------
587 1.3.0   Python   Stem_get_available_languages Use Stem.get_available_languages instead (static method instead of function)
588 ======= ======== ============================ ================================================================================
590 .. [#rswg] This affects all SWIG generated bindings (currently: Python, PHP, Ruby, Tcl8 and CSharp)
592 .. [#rsw2] This affects all SWIG-generated bindings except those for Ruby, support for which was added after the function was deprecated in Xapian-core.
594 .. [#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").
596 .. [#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.
598 Omega
599 -----
601 .. Keep table width to <= 126 columns.
603 ======= =================================== ==================================================================================
604 Removed Feature name                        Upgrade suggestion and comments
605 ======= =================================== ==================================================================================
606 1.0.0   $freqs                              Use ``$map{$queryterms,$_:&nbsp;$nice{$freq{$_}}}`` instead.
607 ------- ----------------------------------- ----------------------------------------------------------------------------------
608 1.0.0   scriptindex -u                      ``-u`` was ignored for compatibility with 0.7.5 and earlier, so just remove it.
609 ------- ----------------------------------- ----------------------------------------------------------------------------------
610 1.0.0   scriptindex -q                      ``-q`` was ignored for compatibility with 0.6.1 and earlier, so just remove it.
611 ------- ----------------------------------- ----------------------------------------------------------------------------------
612 1.1.0   scriptindex index=nopos             Use ``indexnopos`` instead.
613 ------- ----------------------------------- ----------------------------------------------------------------------------------
614 1.3.0   ``OLDP`` CGI parameter              Use ``xP`` CGI parameter instead (direct replacement), which has been supported
615                                             since at least 0.5.0.
616 ======= =================================== ==================================================================================