Class: Velocity::Instance::Query
- Defined in:
- lib/acceleration/velocity.rb
Overview
Query models a query executed through the API. There are a very large number of arguments that can be passed to Query#search and similar methods. See the API documentation for a complete list.
Acquire a Query by executing Velocity::Instance#query; do not instantiate one yourself.
Defined Under Namespace
Classes: Sort
Instance Attribute Summary
Attributes inherited from APIModel
Instance Method Summary collapse
-
#browse(args) ⇒ Object
Execute a browse query, having already executed a regular Query#search and passing the
:browse
option set to true. -
#prefix ⇒ Object
The prefix for the query model.
-
#search(args) ⇒ Object
Execute a standard search using a source the instance.
-
#similar_documents(args) ⇒ Object
Execute a similar documents query.
Methods inherited from APIModel
#initialize, #method_missing, #resolve, #respond_to_missing?
Constructor Details
This class inherits a constructor from Velocity::Instance::APIModel
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Velocity::Instance::APIModel
Instance Method Details
#browse(args) ⇒ Object
Execute a browse query, having already executed a regular Query#search and passing the :browse
option set to true.
You must supply a :file
corresponding to the file that was returned from the original query. This is not checked here, so caveat implementor.
326 327 328 |
# File 'lib/acceleration/velocity.rb', line 326 def browse(args) QueryResponse.new(@instance.call(resolve('browse'), args)) end |
#prefix ⇒ Object
The prefix for the query model
305 306 307 |
# File 'lib/acceleration/velocity.rb', line 305 def prefix 'query' end |
#search(args) ⇒ Object
Execute a standard search using a source the instance.
You’ll want to supply at least a :sources
option and likely a :query
option.
314 315 316 |
# File 'lib/acceleration/velocity.rb', line 314 def search(args) QueryResponse.new(@instance.call(resolve('search'), args)) end |
#similar_documents(args) ⇒ Object
Execute a similar documents query.
You must supply a :document
containing something that will resolve to an XML nodeset containing document nodes. This is not checked here, so caveat implementor.
337 338 339 |
# File 'lib/acceleration/velocity.rb', line 337 def similar_documents(args) QueryResponse.new(@instance.call(resolve('similar-documents'), args)) end |