Class: Xapian::ValueCountMatchSpy

Inherits:
Object
  • Object
show all
Defined in:
lib/xapian.rb

Overview

Refer to the Xapian::ValueCountMatchSpy C++ API documentation for methods not specific to Ruby. – Wrap some dangerous iterators.

Instance Method Summary collapse

Instance Method Details

#top_values(maxvalues) ⇒ Object

Returns an Array of the top values seen, by frequency



307
308
309
310
311
312
# File 'lib/xapian.rb', line 307

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

#valuesObject

Returns an Array of all the values seen, in alphabetical order



299
300
301
302
303
304
# File 'lib/xapian.rb', line 299

def values()
  Xapian._safelyIterate(self._dangerous_values_begin(),
                        self._dangerous_values_end()) { |item|
    Xapian::Term.new(item.term, 0, item.termfreq)
  }
end