Module: DiscourseApi::API::Search

Included in:
Client
Defined in:
lib/discourse_api/api/search.rb

Instance Method Summary collapse

Instance Method Details

#search(term, options = {}) ⇒ Array

Returns search results that match the specified term.

Parameters:

  • term (String)

    a search term

  • options (Hash) (defaults to: {})

    A customizable set of options

Options Hash (options):

  • :type_filter (String)

    Returns results of the specified type.

Returns:

  • (Array)

    Return results as an array of Hashes.



10
11
12
13
# File 'lib/discourse_api/api/search.rb', line 10

def search(term, options={})
  response = get('/search/query', options.merge(term: term))
  response[:body]
end