Class: SiteSearch::SwiftypeAdapter::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/site_search/swiftype_adapter.rb

Overview

One page of engine results plus the Pagy that describes where it sits.
degraded marks a page the engine failed to answer, so "nothing matched"
is never confused with "we never got a reply".

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(items: [], pagy: nil, degraded: false) ⇒ Result

Returns a new instance of Result.

Parameters:

  • items (Array<SiteSearch::ResultItem>) (defaults to: [])
  • pagy (Pagy::Offset, nil) (defaults to: nil)
  • degraded (Boolean) (defaults to: false)

    true when the engine errored or timed out



79
# File 'app/services/site_search/swiftype_adapter.rb', line 79

def initialize(items: [], pagy: nil, degraded: false) = super

Instance Attribute Details

#degradedObject (readonly)

Returns the value of attribute degraded

Returns:

  • (Object)

    the current value of degraded



75
76
77
# File 'app/services/site_search/swiftype_adapter.rb', line 75

def degraded
  @degraded
end

#itemsObject (readonly)

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



75
76
77
# File 'app/services/site_search/swiftype_adapter.rb', line 75

def items
  @items
end

#pagyObject (readonly)

Returns the value of attribute pagy

Returns:

  • (Object)

    the current value of pagy



75
76
77
# File 'app/services/site_search/swiftype_adapter.rb', line 75

def pagy
  @pagy
end