Class: Xapian::Match

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

Overview

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..)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(docid, document, rank, weight, collapse_count, percent) ⇒ Match

Returns a new instance of Match.



93
94
95
96
97
98
99
100
# File 'lib/xapian.rb', line 93

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

Instance Attribute Details

#collapse_countObject

Returns the value of attribute collapse_count.



91
92
93
# File 'lib/xapian.rb', line 91

def collapse_count
  @collapse_count
end

#docidObject

Returns the value of attribute docid.



91
92
93
# File 'lib/xapian.rb', line 91

def docid
  @docid
end

#documentObject

Returns the value of attribute document.



91
92
93
# File 'lib/xapian.rb', line 91

def document
  @document
end

#percentObject

Returns the value of attribute percent.



91
92
93
# File 'lib/xapian.rb', line 91

def percent
  @percent
end

#rankObject

Returns the value of attribute rank.



91
92
93
# File 'lib/xapian.rb', line 91

def rank
  @rank
end

#weightObject

Returns the value of attribute weight.



91
92
93
# File 'lib/xapian.rb', line 91

def weight
  @weight
end

Instance Method Details

#==(other) ⇒ Object

initialize



102
103
104
105
# File 'lib/xapian.rb', line 102

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