Module: Inquisitio
- Defined in:
- lib/inquisitio.rb,
lib/inquisitio/logger.rb,
lib/inquisitio/indexer.rb,
lib/inquisitio/results.rb,
lib/inquisitio/version.rb,
lib/inquisitio/document.rb,
lib/inquisitio/searcher.rb,
lib/inquisitio/configuration.rb,
lib/inquisitio/inquisitio_error.rb,
lib/inquisitio/search_url_builder.rb
Defined Under Namespace
Classes: Configuration, Document, Indexer, InquisitioConfigurationError, InquisitioError, Logger, Results, SearchUrlBuilder, Searcher
Constant Summary collapse
- VERSION =
'2.0.0'
Class Method Summary collapse
-
.config ⇒ Object
Inquisitio configuration settings.
-
.index(documents) ⇒ Object
Index a batch of documents.
-
.page(page) ⇒ Object
Specify a page number.
-
.per(num) ⇒ Object
Specify the amount of results you want back.
-
.returns(num) ⇒ Object
Specify which fields you want returned.
-
.search ⇒ Object
Exectues the generated query and returns self.
-
.where(query) ⇒ Object
Specify a condition as either a string, an array, or a hash.
Class Method Details
.config ⇒ Object
Inquisitio configuration settings.
Settings should be set in an initializer or using some other method that insures they are set before any Inquisitio code is used. They can be set as followed:
Inquisitio.config.access_key = "my-access-key"
The following settings are allowed:
-
:access_key- The AWS access key -
:secret_key- The AWS secret key -
:queue_region- The AWS region is included in. -
:logger- A logger object that responds to puts.
29 30 31 32 33 34 35 36 |
# File 'lib/inquisitio.rb', line 29 def self.config @config ||= Configuration.new if block_given? yield @config else @config end end |
.index(documents) ⇒ Object
Index a batch of documents.
76 77 78 |
# File 'lib/inquisitio.rb', line 76 def self.index(documents) Indexer.index([documents]) end |
.page(page) ⇒ Object
Specify a page number. Defaults to 1
55 56 57 |
# File 'lib/inquisitio.rb', line 55 def self.page(page) Searcher.page(page) end |
.per(num) ⇒ Object
Specify the amount of results you want back
62 63 64 |
# File 'lib/inquisitio.rb', line 62 def self.per(num) Searcher.per(num) end |
.returns(num) ⇒ Object
Specify which fields you want returned.
69 70 71 |
# File 'lib/inquisitio.rb', line 69 def self.returns(num) Searcher.returns(num) end |