Module: Slack::Endpoint::Search

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/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.

  • :count (Object)

    Number of items to return per page.

  • :highlight (Object)

    Pass a value of true to enable query highlight markers (see below).

  • :page (Object)

    Page number of results to return.

  • :sort (Object)

    Return matches sorted by either score or timestamp.

  • :sort_dir (Object)

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

See Also:



24
25
26
27
# File 'lib/slack/endpoint/search.rb', line 24

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 contain booleans, etc.

  • :count (Object)

    Number of items to return per page.

  • :highlight (Object)

    Pass a value of true to enable query highlight markers (see below).

  • :page (Object)

    Page number of results to return.

  • :sort (Object)

    Return matches sorted by either score or timestamp.

  • :sort_dir (Object)

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

See Also:



47
48
49
50
# File 'lib/slack/endpoint/search.rb', line 47

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.

  • :count (Object)

    Pass the number of results you want per “page”. Maximum of 100.

  • :highlight (Object)

    Pass a value of true to enable query highlight markers (see below).

  • :page (Object)

    Page number of results to return.

  • :sort (Object)

    Return matches sorted by either score or timestamp.

  • :sort_dir (Object)

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

See Also:



70
71
72
73
# File 'lib/slack/endpoint/search.rb', line 70

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