Module: Slack::Web::Api::Endpoints::Search

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/search.rb

Instance Method Summary collapse

Instance Method Details

#search_all(options = {}) ⇒ Object

Searches for messages and files matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query. May contains booleans, etc.

  • :sort (Object)

    Return matches sorted by either ‘score` or `timestamp`.

  • :sort_dir (Object)

    Change sort direction to ascending (‘asc`) or descending (`desc`).

  • :highlight (Object)

    Pass a value of ‘1` to enable query highlight markers (see below).

See Also:



22
23
24
25
# File 'lib/slack/web/api/endpoints/search.rb', line 22

def search_all(options = {})
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
  post('search.all', options)
end

#search_files(options = {}) ⇒ Object

Searches for files matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query. May contains booleans, etc.

  • :sort (Object)

    Return matches sorted by either ‘score` or `timestamp`.

  • :sort_dir (Object)

    Change sort direction to ascending (‘asc`) or descending (`desc`).

  • :highlight (Object)

    Pass a value of ‘1` to enable query highlight markers (see below).

See Also:



41
42
43
44
# File 'lib/slack/web/api/endpoints/search.rb', line 41

def search_files(options = {})
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
  post('search.files', options)
end

#search_messages(options = {}) ⇒ Object

Searches for messages matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query. May contains booleans, etc.

  • :sort (Object)

    Return matches sorted by either ‘score` or `timestamp`.

  • :sort_dir (Object)

    Change sort direction to ascending (‘asc`) or descending (`desc`).

  • :highlight (Object)

    Pass a value of ‘1` to enable query highlight markers (see below).

See Also:



60
61
62
63
# File 'lib/slack/web/api/endpoints/search.rb', line 60

def search_messages(options = {})
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
  post('search.messages', options)
end