Sha256: 7a4bbffd2baf182e792ed85ae146a2d6c210f4c394f4636aca838fb2842ba58a

Contents?: true

Size: 867 Bytes

Versions: 60

Compression:

Stored size: 867 Bytes

Contents

# Due to the load order of classes, Backend precedes the required Base class.
require_relative 'base'

module Udongo::Search
  # The goal of this class is to provide a manipulated version of the filtered
  # index data that we can use in the result set of an autocomplete-triggered
  # search query. See Udongo::Search::Base for more information on how this
  # search functionality is designed.
  class Backend < Udongo::Search::Base
    # This translates the filtered indices into meaningful result objects.
    # These require a { label: ... value: ... } to accommodate jquery-ui.
    #
    # Note that the result_object#url method is defined in
    # Udongo::Search::ResultObjects::Backend::Page.
    def search
      indices.map do |index|
        result = result_object(index)
        { label: result.build_html, value: result.url }
      end
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
udongo-7.9.0 lib/udongo/search/backend.rb
udongo-7.8.1 lib/udongo/search/backend.rb
udongo-7.8.0 lib/udongo/search/backend.rb
udongo-7.7.2 lib/udongo/search/backend.rb
udongo-7.7.1 lib/udongo/search/backend.rb
udongo-7.7.0 lib/udongo/search/backend.rb
udongo-7.6.2 lib/udongo/search/backend.rb
udongo-7.6.1 lib/udongo/search/backend.rb
udongo-7.6.0 lib/udongo/search/backend.rb
udongo-7.5.1 lib/udongo/search/backend.rb
udongo-7.5.0 lib/udongo/search/backend.rb
udongo-7.4.2 lib/udongo/search/backend.rb
udongo-7.4.1 lib/udongo/search/backend.rb
udongo-7.4.0 lib/udongo/search/backend.rb
udongo-7.3.5 lib/udongo/search/backend.rb
udongo-7.3.4 lib/udongo/search/backend.rb
udongo-7.3.3 lib/udongo/search/backend.rb
udongo-7.3.2 lib/udongo/search/backend.rb
udongo-7.3.1 lib/udongo/search/backend.rb
udongo-7.2.1 lib/udongo/search/backend.rb