Module: Slack::Web::Api::Endpoints::AssistantSearch

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

Instance Method Summary collapse

Instance Method Details

#assistant_search_context(options = {}) ⇒ Object

Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (string)

    User prompt or search query.

  • :action_token (string)

    Send action_token as received in a message event.

  • :channel_types (array)

    Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.

  • :content_types (array)

    Content types to include, a comma-separated list of any combination of messages, files, channels, users.

  • :include_bots (boolean)

    If you want the results to include bots.

  • :before (integer)

    UNIX timestamp filter. If present, filters for results before this date.

  • :after (integer)

    UNIX timestamp filter. If present, filters for results after this date.

  • :include_context_messages (boolean)

    Whether to include context messages surrounding the main message result. Defaults to false if unspecified.

  • :context_channel_id (Object)

    Context channel ID to support scoping the search when applicable.

  • :cursor (string)

    The cursor returned by the API. Leave this blank for the first request, and use this to get the next page of results.

  • :limit (integer)

    Number of results to return, up to a max of 20. Defaults to 20.

  • :sort (enum)

    The field to sort the results by. Defaults to score. Can be one of: score, timestamp.

  • :sort_dir (enum)

    The direction to sort the results by. Defaults to desc.

  • :include_message_blocks (boolean)

    Whether to return the message blocks in the response.

  • :highlight (boolean)

    Whether to highlight the search query in the results. Defaults to false if unspecified.

  • :term_clauses (array)

    A list of term clauses. A term clause is a string with search terms. Search results returned will match every term clause specified (i.e. conjunctive normal form).

Raises:

  • (ArgumentError)

See Also:



46
47
48
49
50
51
52
53
54
55
# File 'lib/slack/web/api/endpoints/assistant_search.rb', line 46

def assistant_search_context(options = {})
  raise ArgumentError, 'Required arguments :query missing' if options[:query].nil?
  if block_given?
    Pagination::Cursor.new(self, :assistant_search_context, options).each do |page|
      yield page
    end
  else
    post('assistant.search.context', options)
  end
end

#assistant_search_info(options = {}) ⇒ Object

Returns search capabilities on a given team.



62
63
64
# File 'lib/slack/web/api/endpoints/assistant_search.rb', line 62

def assistant_search_info(options = {})
  post('assistant.search.info', options)
end