Module: Nesta::Plugin::Search

Defined in:
lib/nesta-plugin-search/init.rb,
lib/nesta-plugin-search/version.rb

Defined Under Namespace

Classes: Index

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.results(index, term) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/nesta-plugin-search/init.rb', line 33

def self.results index, term
  results = []
  index.search_each(term) do |key, score|
    results.push Nesta::Page.find_by_path(index[key][:href])# rescue nil
  end
  results
end