Class: Ferret::Search::Spans::NearSpansEnum::CellQueue

Inherits:
Utils::PriorityQueue show all
Defined in:
lib/ferret/search/spans/near_spans_enum.rb

Instance Attribute Summary

Attributes inherited from Utils::PriorityQueue

#size

Instance Method Summary collapse

Methods inherited from Utils::PriorityQueue

#adjust_top, #clear, #initialize, #insert, #pop, #push, #put_heap, #top

Constructor Details

This class inherits a constructor from Ferret::Utils::PriorityQueue

Instance Method Details

#less_than(o1, o2) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ferret/search/spans/near_spans_enum.rb', line 5

def less_than(o1, o2) 
  if (o1.doc == o2.doc) 
    if (o1.start == o2.start) 
      if (o1.finish == o2.finish) 
        return o1.index > o2.index
      else 
        return o1.finish < o2.finish
      end
    else 
      return o1.start < o2.start
    end
  else 
    return o1.doc < o2.doc
  end
end