# :title:Ruby Xapian bindings
# =Ruby Xapian bindings
#
# Original version by Paul Legato (plegato@nks.net), 4/20/06.
#
# Copyright (C) 2006 Networked Knowledge Systems, Inc.
# Copyright (C) 2008,2011 Olly Betts
# Copyright (C) 2010 Richard Boulton
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
# USA
#
# ==Underscore methods
# Note: Methods whose names start with an underscore character _ are internal
# methods from the C++ API. Their functionality is not accessible in a
# Ruby-friendly way, so this file provides wrapper code to make it easier to
# use them from a Ruby programming idiom.  Most are also dangerous insofar as
# misusing them can cause your program to segfault.  In particular, all of
# Xapian's *Iterator classes are wrapped into nice Ruby-friendly Arrays.
#
# It should never be necessary to use any method whose name starts with an
# underscore from user-level code. Make sure you are _VERY_ certain that you
# know exactly what you're doing if you do use one of these methods. Beware.
# You've been warned...
#


module Xapian
  ######## load the SWIG-generated library
  require '_xapian'


  # iterate over two dangerous iterators (i.e. those that can cause segfaults
  # if used improperly.)
  # Return the results as an Array.
  # Users should never need to use this method.
  #
  # Takes a block that returns some appropriate Ruby object to wrap the
  # underlying Iterator
  def _safelyIterate(dangerousStart, dangerousEnd) #:nodoc:
    retval = Array.new
    
    item = dangerousStart
    lastTerm = dangerousEnd
    
    return retval if dangerousStart.equals(dangerousEnd)

    begin      
      retval.push(yield(item))
      item.next()
    end while not item.equals(lastTerm) # must use primitive C++ comparator 
    
    return retval
  end # _safelyIterate
  module_function :_safelyIterate

  #--
  ### safe Ruby wrapper for the dangerous C++ Xapian::TermIterator class
  class Xapian::Term
    attr_accessor :term, :wdf, :termfreq

    def initialize(term, wdf=nil, termfreq=nil)
      @term = term
      @wdf = wdf
      @termfreq = termfreq
    end

    def ==(other)
      return other.is_a?(Xapian::Term) && other.term == @term && other.wdf == @wdf && other.termfreq == @termfreq
    end
  end # class Term

  ### Ruby wrapper for a Match, i.e. a Xapian::MSetIterator (Match Set) in C++.
  # it's no longer an iterator in the Ruby version, but we want to preserve its
  # non-iterative data.
  # (MSetIterator is not dangerous, but it is inconvenient to use from a Ruby
  # idiom, so we wrap it..)
  class Xapian::Match     
    attr_accessor :docid, :document, :rank, :weight, :collapse_count, :percent

    def initialize(docid, document, rank, weight, collapse_count, percent)
      @docid = docid
      @document = document
      @rank = rank
      @weight = weight
      @collapse_count = collapse_count
      @percent = percent
    end # initialize

    def ==(other)
      return other.is_a?(Xapian::Match) && other.docid == @docid && other.rank == @rank && 
        other.weight == @weight && other.collapse_count == @collapse_count && other.percent == @percent
    end
  end # class Xapian::Match

  # Ruby wrapper for an ExpandTerm, i.e. a Xapian::ESetIterator in C++
  # Not dangerous, but inconvenient to use from a Ruby programming idiom, so we
  # wrap it.
  class Xapian::ExpandTerm
    attr_accessor :name, :weight

    def initialize(name, weight)
      @name = name
      @weight = weight
    end # initialize

    def ==(other)
      return other.is_a?(Xapian::ExpandTerm) && other.name == @name && other.weight == @weight
    end

  end # Xapian::ExpandTerm

  # Ruby wrapper for Xapian::ValueIterator
  class Xapian::Value
    attr_accessor :value, :valueno, :docid
    
    def initialize(value, valueno, docid)
      @value = value
      @valueno = valueno
      @docid = docid
    end # initialize

    def ==(other)
      return other.is_a?(Xapian::Value) && other.value == @value && other.valueno == @valueno && other.docid == @docid
    end
  end # Xapian::Value

  # Refer to the
  # {Xapian::Document C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Document.html]
  # for methods not specific to Ruby.
  #--
  # Extend Xapian::Document with a nice wrapper for its nasty input_iterators
  class Xapian::Document
    def terms
      Xapian._safelyIterate(self._dangerous_termlist_begin(), self._dangerous_termlist_end()) { |item|
        Xapian::Term.new(item.term, item.wdf)
      }
    end # terms

    def values
      Xapian._safelyIterate(self._dangerous_values_begin(), self._dangerous_values_end()) { |item|
        Xapian::Value.new(item.value, item.valueno, 0)
      }
    end # values

  end # class Xapian::Document

  # Refer to the
  # {Xapian::Query C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Query.html]
  # for methods not specific to Ruby.
  #--
  # Extend Xapian::Query with a nice wrapper for its dangerous iterators
  class Xapian::Query
    def terms
      Xapian._safelyIterate(self._dangerous_terms_begin(), self._dangerous_terms_end()) { |item|
        Xapian::Term.new(item.term, item.wdf)
        # termfreq is not supported by TermIterators from Queries
      }
    end # terms
  end # Xapian::Query

  # Refer to the
  # {Xapian::Enquire C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Enquire.html]
  # for methods not specific to Ruby.
  #--
  # Extend Xapian::Enquire with a nice wrapper for its dangerous iterators
  class Xapian::Enquire
    # Get matching terms for some document.
    # document can be either a Xapian::DocID or a Xapian::MSetIterator
    def matching_terms(document)
      Xapian._safelyIterate(self._dangerous_matching_terms_begin(document), 
                            self._dangerous_matching_terms_end(document)) { |item|
        Xapian::Term.new(item.term, item.wdf)
      }
    end # matching_terms
  end # Xapian::Enquire

  # Refer to the
  # {Xapian::MSet C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1MSet.html]
  # for methods not specific to Ruby.
  #--
  # MSetIterators are not dangerous, just inconvenient to use within a Ruby
  # programming idiom. So we wrap them.
  class Xapian::MSet
    def matches
      Xapian._safelyIterate(self._begin(), 
                            self._end()) { |item|
        Xapian::Match.new(item.docid, item.document, item.rank, item.weight, item.collapse_count, item.percent)
      }

    end # matches
  end # Xapian::MSet

  # Refer to the
  # {Xapian::ESet C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ESet.html]
  # for methods not specific to Ruby.
  #--
  # ESetIterators are not dangerous, just inconvenient to use within a Ruby
  # programming idiom. So we wrap them.
  class Xapian::ESet
    def terms
      Xapian._safelyIterate(self._begin(), 
                            self._end()) { |item|
	# note: in the ExpandTerm wrapper, we implicitly rename
	# ESetIterator#term() (defined in xapian-headers.i) to ExpandTerm#term()
        Xapian::ExpandTerm.new(item.term, item.weight)
      }

    end # terms
  end # Xapian::ESet


  #--
  # Wrapper for the C++ class Xapian::PostingIterator
  class Xapian::Posting
    attr_accessor :docid, :doclength, :wdf

    def initialize(docid, doclength, wdf)
      @docid = docid
      @doclength = doclength
      @wdf = wdf
    end

    def ==(other)
      return other.is_a?(Xapian::Posting) && other.docid == @docid && other.doclength == @doclength &&
        other.wdf == @wdf
    end
  end # Xapian::Posting

  # Refer to the
  # {Xapian::Database C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Database.html]
  # for methods not specific to Ruby.
  #--
  # Wrap some dangerous iterators.
  class Xapian::Database
    # Returns an Array of all Xapian::Terms for this database.
    def allterms(pref = '')
      Xapian._safelyIterate(self._dangerous_allterms_begin(pref),
                            self._dangerous_allterms_end(pref)) { |item|
        Xapian::Term.new(item.term, 0, item.termfreq)
      }
    end # allterms

    # Returns an Array of Xapian::Postings for the given term.
    # term is a string.
    def postlist(term)
      Xapian._safelyIterate(self._dangerous_postlist_begin(term), 
                            self._dangerous_postlist_end(term)) { |item|
        Xapian::Posting.new(item.docid, item.doclength, item.wdf)
      }      
    end # postlist(term)

    # Returns an Array of Terms for the given docid.
    def termlist(docid)
      Xapian._safelyIterate(self._dangerous_termlist_begin(docid),
                            self._dangerous_termlist_end(docid)) { |item|
        Xapian::Term.new(item.term, item.wdf, item.termfreq)
      }
    end # termlist(docid)
    
    # Returns an Array of Xapian::Termpos objects for the given term (a String)
    # in the given docid.
    def positionlist(docid, term)
      Xapian._safelyIterate(self._dangerous_positionlist_begin(docid, term),
                            self._dangerous_positionlist_end(docid, term)) { |item|
        item.termpos
      }
    end # positionlist

    # Returns an Array of Xapian::Value objects for the given slot in the
    # database.
    def valuestream(slot)
      Xapian._safelyIterate(self._dangerous_valuestream_begin(slot),
                            self._dangerous_valuestream_end(slot)) { |item|
        Xapian::Value.new(item.value, slot, item.docid)
      }
    end # valuestream(slot)
  end # Xapian::Database

  # Refer to the
  # {Xapian::ValueCountMatchSpy C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ValueCountMatchSpy.html]
  # for methods not specific to Ruby.
  #--
  # Wrap some dangerous iterators.
  class Xapian::ValueCountMatchSpy
    # Returns an Array of all the values seen, in alphabetical order
    def values()
      Xapian._safelyIterate(self._dangerous_values_begin(),
                            self._dangerous_values_end()) { |item|
        Xapian::Term.new(item.term, 0, item.termfreq)
      }
    end # values

    # Returns an Array of the top values seen, by frequency
    def top_values(maxvalues)
      Xapian._safelyIterate(self._dangerous_top_values_begin(maxvalues),
                            self._dangerous_top_values_end(maxvalues)) { |item|
        Xapian::Term.new(item.term, 0, item.termfreq)
      }
    end # top_values
  end # Xapian::Database

  # Refer to the
  # {Xapian::LatLongCoords C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LatLongCoords.html]
  # for methods not specific to Ruby.
  #--
  # Wrap some dangerous iterators.
  class Xapian::LatLongCoords
    # Returns an Array of all the values seen, in alphabetical order
    def all()
      Xapian._safelyIterate(self._begin(),
                            self._end()) { |item|
        item.get_coord()
      }
    end # allterms
  end # Xapian::LatLongCoords

end # Xapian module
  # Refer to the
  # {Xapian::AssertionError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1AssertionError.html].
  class Xapian::AssertionError
  end
  # Refer to the
  # {Xapian::BB2Weight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1BB2Weight.html].
  class Xapian::BB2Weight
  end
  # Refer to the
  # {Xapian::BM25Weight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1BM25Weight.html].
  class Xapian::BM25Weight
  end
  # Refer to the
  # {Xapian::BoolWeight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1BoolWeight.html].
  class Xapian::BoolWeight
  end
  # Refer to the
  # {Xapian::Compactor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Compactor.html].
  class Xapian::Compactor
  end
  # Refer to the
  # {Xapian::DLHWeight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DLHWeight.html].
  class Xapian::DLHWeight
  end
  # Refer to the
  # {Xapian::DPHWeight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DPHWeight.html].
  class Xapian::DPHWeight
  end
  # Refer to the
  # {Xapian::DatabaseCorruptError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DatabaseCorruptError.html].
  class Xapian::DatabaseCorruptError
  end
  # Refer to the
  # {Xapian::DatabaseCreateError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DatabaseCreateError.html].
  class Xapian::DatabaseCreateError
  end
  # Refer to the
  # {Xapian::DatabaseError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DatabaseError.html].
  class Xapian::DatabaseError
  end
  # Refer to the
  # {Xapian::DatabaseLockError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DatabaseLockError.html].
  class Xapian::DatabaseLockError
  end
  # Refer to the
  # {Xapian::DatabaseModifiedError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DatabaseModifiedError.html].
  class Xapian::DatabaseModifiedError
  end
  # Refer to the
  # {Xapian::DatabaseOpeningError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DatabaseOpeningError.html].
  class Xapian::DatabaseOpeningError
  end
  # Refer to the
  # {Xapian::DatabaseVersionError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DatabaseVersionError.html].
  class Xapian::DatabaseVersionError
  end
  # Refer to the
  # {Xapian::DateRangeProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DateRangeProcessor.html].
  class Xapian::DateRangeProcessor
  end
  # Refer to the
  # {Xapian::DateValueRangeProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DateValueRangeProcessor.html].
  class Xapian::DateValueRangeProcessor
  end
  # Refer to the
  # {Xapian::DecreasingValueWeightPostingSource C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DecreasingValueWeightPostingSource.html].
  class Xapian::DecreasingValueWeightPostingSource
  end
  # Refer to the
  # {Xapian::DocNotFoundError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1DocNotFoundError.html].
  class Xapian::DocNotFoundError
  end
  # Refer to the
  # {Xapian::ESetIterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ESetIterator.html].
  class Xapian::ESetIterator
  end
  # Refer to the
  # {Xapian::Error C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Error.html].
  class Xapian::Error
  end
  # Refer to the
  # {Xapian::ErrorHandler C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ErrorHandler.html].
  class Xapian::ErrorHandler
  end
  # Refer to the
  # {Xapian::ExpandDecider C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ExpandDecider.html].
  class Xapian::ExpandDecider
  end
  # Refer to the
  # {Xapian::ExpandDeciderAnd C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ExpandDeciderAnd.html].
  class Xapian::ExpandDeciderAnd
  end
  # Refer to the
  # {Xapian::ExpandDeciderFilterPrefix C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ExpandDeciderFilterPrefix.html].
  class Xapian::ExpandDeciderFilterPrefix
  end
  # Refer to the
  # {Xapian::ExpandDeciderFilterTerms C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ExpandDeciderFilterTerms.html].
  class Xapian::ExpandDeciderFilterTerms
  end
  # Refer to the
  # {Xapian::FeatureUnavailableError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1FeatureUnavailableError.html].
  class Xapian::FeatureUnavailableError
  end
  # Refer to the
  # {Xapian::FieldProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1FieldProcessor.html].
  class Xapian::FieldProcessor
  end
  # Refer to the
  # {Xapian::FixedWeightPostingSource C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1FixedWeightPostingSource.html].
  class Xapian::FixedWeightPostingSource
  end
  # Refer to the
  # {Xapian::GreatCircleMetric C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1GreatCircleMetric.html].
  class Xapian::GreatCircleMetric
  end
  # Refer to the
  # {Xapian::IfB2Weight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1IfB2Weight.html].
  class Xapian::IfB2Weight
  end
  # Refer to the
  # {Xapian::InL2Weight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1InL2Weight.html].
  class Xapian::InL2Weight
  end
  # Refer to the
  # {Xapian::IneB2Weight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1IneB2Weight.html].
  class Xapian::IneB2Weight
  end
  # Refer to the
  # {Xapian::InternalError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1InternalError.html].
  class Xapian::InternalError
  end
  # Refer to the
  # {Xapian::InvalidArgumentError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1InvalidArgumentError.html].
  class Xapian::InvalidArgumentError
  end
  # Refer to the
  # {Xapian::InvalidOperationError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1InvalidOperationError.html].
  class Xapian::InvalidOperationError
  end
  # Refer to the
  # {Xapian::KeyMaker C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1KeyMaker.html].
  class Xapian::KeyMaker
  end
  # Refer to the
  # {Xapian::LMWeight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LMWeight.html].
  class Xapian::LMWeight
  end
  # Refer to the
  # {Xapian::LatLongCoordsIterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LatLongCoordsIterator.html].
  class Xapian::LatLongCoordsIterator
  end
  # Refer to the
  # {Xapian::LatLongDistanceKeyMaker C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LatLongDistanceKeyMaker.html].
  class Xapian::LatLongDistanceKeyMaker
  end
  # Refer to the
  # {Xapian::LatLongDistancePostingSource C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LatLongDistancePostingSource.html].
  class Xapian::LatLongDistancePostingSource
  end
  # Refer to the
  # {Xapian::LatLongMetric C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LatLongMetric.html].
  class Xapian::LatLongMetric
  end
  # Refer to the
  # {Xapian::LogicError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LogicError.html].
  class Xapian::LogicError
  end
  # Refer to the
  # {Xapian::MSetIterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1MSetIterator.html].
  class Xapian::MSetIterator
  end
  # Refer to the
  # {Xapian::MatchDecider C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1MatchDecider.html].
  class Xapian::MatchDecider
  end
  # Refer to the
  # {Xapian::MatchSpy C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1MatchSpy.html].
  class Xapian::MatchSpy
  end
  # Refer to the
  # {Xapian::MultiValueKeyMaker C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1MultiValueKeyMaker.html].
  class Xapian::MultiValueKeyMaker
  end
  # Refer to the
  # {Xapian::NetworkError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1NetworkError.html].
  class Xapian::NetworkError
  end
  # Refer to the
  # {Xapian::NetworkTimeoutError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1NetworkTimeoutError.html].
  class Xapian::NetworkTimeoutError
  end
  # Refer to the
  # {Xapian::NumberRangeProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1NumberRangeProcessor.html].
  class Xapian::NumberRangeProcessor
  end
  # Refer to the
  # {Xapian::NumberValueRangeProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1NumberValueRangeProcessor.html].
  class Xapian::NumberValueRangeProcessor
  end
  # Refer to the
  # {Xapian::PL2Weight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1PL2Weight.html].
  class Xapian::PL2Weight
  end
  # Refer to the
  # {Xapian::PositionIterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1PositionIterator.html].
  class Xapian::PositionIterator
  end
  # Refer to the
  # {Xapian::PostingIterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1PostingIterator.html].
  class Xapian::PostingIterator
  end
  # Refer to the
  # {Xapian::PostingSource C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1PostingSource.html].
  class Xapian::PostingSource
  end
  # Refer to the
  # {Xapian::QueryParser C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html].
  class Xapian::QueryParser
  end
  # Refer to the
  # {Xapian::QueryParserError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1QueryParserError.html].
  class Xapian::QueryParserError
  end
  # Refer to the
  # {Xapian::RSet C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1RSet.html].
  class Xapian::RSet
  end
  # Refer to the
  # {Xapian::RangeError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1RangeError.html].
  class Xapian::RangeError
  end
  # Refer to the
  # {Xapian::RangeProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1RangeProcessor.html].
  class Xapian::RangeProcessor
  end
  # Refer to the
  # {Xapian::Registry C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Registry.html].
  class Xapian::Registry
  end
  # Refer to the
  # {Xapian::RuntimeError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1RuntimeError.html].
  class Xapian::RuntimeError
  end
  # Refer to the
  # {Xapian::SerialisationError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1SerialisationError.html].
  class Xapian::SerialisationError
  end
  # Refer to the
  # {Xapian::SimpleStopper C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1SimpleStopper.html].
  class Xapian::SimpleStopper
  end
  # Refer to the
  # {Xapian::Stem C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Stem.html].
  class Xapian::Stem
  end
  # Refer to the
  # {Xapian::StemImplementation C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1StemImplementation.html].
  class Xapian::StemImplementation
  end
  # Refer to the
  # {Xapian::Stopper C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Stopper.html].
  class Xapian::Stopper
  end
  # Refer to the
  # {Xapian::StringValueRangeProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1StringValueRangeProcessor.html].
  class Xapian::StringValueRangeProcessor
  end
  # Refer to the
  # {Xapian::TermGenerator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1TermGenerator.html].
  class Xapian::TermGenerator
  end
  # Refer to the
  # {Xapian::TermIterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1TermIterator.html].
  class Xapian::TermIterator
  end
  # Refer to the
  # {Xapian::TfIdfWeight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1TfIdfWeight.html].
  class Xapian::TfIdfWeight
  end
  # Refer to the
  # {Xapian::TradWeight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1TradWeight.html].
  class Xapian::TradWeight
  end
  # Refer to the
  # {Xapian::UnimplementedError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1UnimplementedError.html].
  class Xapian::UnimplementedError
  end
  # Refer to the
  # {Xapian::Utf8Iterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Utf8Iterator.html].
  class Xapian::Utf8Iterator
  end
  # Refer to the
  # {Xapian::ValueIterator C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ValueIterator.html].
  class Xapian::ValueIterator
  end
  # Refer to the
  # {Xapian::ValueMapPostingSource C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ValueMapPostingSource.html].
  class Xapian::ValueMapPostingSource
  end
  # Refer to the
  # {Xapian::ValuePostingSource C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ValuePostingSource.html].
  class Xapian::ValuePostingSource
  end
  # Refer to the
  # {Xapian::ValueRangeProcessor C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ValueRangeProcessor.html].
  class Xapian::ValueRangeProcessor
  end
  # Refer to the
  # {Xapian::ValueSetMatchDecider C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ValueSetMatchDecider.html].
  class Xapian::ValueSetMatchDecider
  end
  # Refer to the
  # {Xapian::ValueWeightPostingSource C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1ValueWeightPostingSource.html].
  class Xapian::ValueWeightPostingSource
  end
  # Refer to the
  # {Xapian::Weight C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1Weight.html].
  class Xapian::Weight
  end
  # Refer to the
  # {Xapian::WildcardError C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1WildcardError.html].
  class Xapian::WildcardError
  end
  # Refer to the
  # {Xapian::WritableDatabase C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1WritableDatabase.html].
  class Xapian::WritableDatabase
  end
  # Refer to the
  # {Xapian::LatLongCoord C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LatLongCoord.html].
  class Xapian::LatLongCoord
  end
  # Refer to the
  # {Xapian::MultiValueKeyMaker::KeySpec C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1MultiValueKeyMaker::KeySpec.html].
  class Xapian::MultiValueKeyMaker::KeySpec
  end
