naive_bayes/resources/ruby/scope.rb
# Modify this +Scope+ to set options for the query.
#
# @param q_opts [Hash] Query options.
#
# @option q_opts :snapshot [true, false] Prevents returning docs more
#   than once.
# @option q_opts :max_scan [Integer] Constrain the query to only scan the
#   specified number of docs.
# @option q_opts :show_disk_loc [true, false] Return disk location info
#   as a field in each doc.
#
# @return [Scope] self
Modify this +Scope+ to set options for the query.
Modify this + Scope + to set options for the query .
def query_opts!(q_opts = nil)
      return self if q_opts.nil?
      [:snapshot, :max_scan, :show_disk_loc].each do |k|
        q_opts[k].nil? ? @opts.delete(k) : @opts.merge!(k => q_opts[k])
      end
      self
    end
def query_opts! ( q_opts = nil ) return self if q_opts . nil? [ :snapshot , :max_scan , :show_disk_loc ] . each do | k | q_opts [ k ] . nil? ? @opts . delete ( k ) : @opts . merge! ( k => q_opts [ k ] ) end self end
Modify this +Scope+ to set options for the query.
Modify this + Scope + to set options for the query .
None
Scope
q_opts
:show_disk_loc  Return disk location info as a field in each doc.
: show_disk_loc Return disk location info as a field in each doc .