class Xapian::Database - RDoc Documentation
Description: class Xapian::Database: xapian. classXapian_1_1Database.
Keywords: ruby,class,Xapian::Database

# class Xapian::Database

Refer to the Xapian::Database C++ API documentation for methods not specific to Ruby.

### Public Instance Methods

allterms (pref = '', &block)
Source

    # File xapian.rb, line 269
    def allterms(pref = '', &block)
      Xapian._safelyIterate(self._dangerous_allterms_begin(pref),
                            self._dangerous_allterms_end(pref),
                            lambda { |item| Xapian::Term.new(item.term, 0, item.termfreq) },
                            &block)
    end

Returns an Array of all Xapian::Terms for this database.

metadata_keys (pref = '', &block)
Source

    # File xapian.rb, line 277
    def metadata_keys(pref = '', &block)
      Xapian._safelyIterate(self._dangerous_metadata_keys_begin(pref),
                            self._dangerous_metadata_keys_end(pref),
                            lambda { |item| item.term },
                            &block)
    end

Returns an Array of all metadata keys for this database.

positionlist (docid, term, &block)
Source

    # File xapian.rb, line 303
    def positionlist(docid, term, &block)
      Xapian._safelyIterate(self._dangerous_positionlist_begin(docid, term),
                            self._dangerous_positionlist_end(docid, term),
                            lambda { |item| item.termpos },
                            &block)
    end

Returns an Array of term positions for the given term (a String) in the given docid.

postlist (term, &block)
Source

    # File xapian.rb, line 286
    def postlist(term, &block)
      Xapian._safelyIterate(self._dangerous_postlist_begin(term),
                            self._dangerous_postlist_end(term),
                            lambda { |item| Xapian::Posting.new(item.docid, item.doclength, item.wdf) },
                            &block)
    end

Returns an Array of Xapian::Postings for the given term. term is a string.

spellings (&block)
Source

    # File xapian.rb, line 320
    def spellings(&block)
      Xapian._safelyIterate(self._dangerous_spellings_begin(),
                            self._dangerous_spellings_end(),
                            lambda { |item| Xapian::Term.new(item.term, 0, item.termfreq) },
                            &block)
    end

Returns an Array of `Xapian::Term` objects for the spelling dictionary.

synonym_keys (&block)
Source

    # File xapian.rb, line 336
    def synonym_keys(&block)
      Xapian._safelyIterate(self._dangerous_synonym_keys_begin(),
                            self._dangerous_synonym_keys_end(),
                            lambda { |item| item.term },
                            &block)
    end

Returns an Array of terms with synonyms.

synonyms (term, &block)
Source

    # File xapian.rb, line 328
    def synonyms(term, &block)
      Xapian._safelyIterate(self._dangerous_synonyms_begin(term),
                            self._dangerous_synonyms_end(term),
                            lambda { |item| item.term },
                            &block)
    end

Returns an Array of synonyms of the given term.

termlist (docid, &block)
Source

    # File xapian.rb, line 294
    def termlist(docid, &block)
      Xapian._safelyIterate(self._dangerous_termlist_begin(docid),
                            self._dangerous_termlist_end(docid),
                            lambda { |item| Xapian::Term.new(item.term, item.wdf, item.termfreq) },
                            &block)
    end

Returns an Array of Terms for the given docid.

valuestream (slot, &block)
Source

    # File xapian.rb, line 312
    def valuestream(slot, &block)
      Xapian._safelyIterate(self._dangerous_valuestream_begin(slot),
                            self._dangerous_valuestream_end(slot),
                            lambda { |item| Xapian::Value.new(item.value, slot, item.docid) },
                            &block)
    end

Returns an Array of `Xapian::Value` objects for the given slot in the database.