Module: DocumentCloud::API::Search

Includes:
Utils
Included in:
Client
Defined in:
lib/document_cloud/api/search.rb

Constant Summary collapse

SEARCH_PATH =
'/search.json'

Instance Method Summary collapse

Methods included from Utils

#build_object, #build_objects, #parse_json

Instance Method Details

#search(q, options = {}) ⇒ Object

Search catalog of public documents

Parameters:

  • q (String)

    The search query

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

    Customizable set of options

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

    :page Response page number

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

    :per_page The number of documents to return per page

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

    :sections Include document sections in the results

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

    :annotations Include document annotations in the results

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

    :data Include key/value data in the results

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

    :mentions Include highlighted mentions of the search phrase

See Also:



19
20
21
# File 'lib/document_cloud/api/search.rb', line 19

def search(q, options={})
  build_object DocumentCloud::SearchResults, get(SEARCH_PATH, options.merge(:q => q))
end