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.



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

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.



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

def collapse_count
  @collapse_count
end

#docidObject

Returns the value of attribute docid.



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

def docid
  @docid
end

#documentObject

Returns the value of attribute document.



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

def document
  @document
end

#percentObject

Returns the value of attribute percent.



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

def percent
  @percent
end

#rankObject

Returns the value of attribute rank.



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

def rank
  @rank
end

#weightObject

Returns the value of attribute weight.



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

def weight
  @weight
end

Instance Method Details

#==(other) ⇒ Object

initialize



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

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