def query(collection_id, bucket_id, terms_text, limit, offset)
      cmd = "QUERY #{collection_id} #{bucket_id} #{terms_text}"
      cmd += " LIMIT(#{limit})" unless limit.nil?
      cmd += " OFFSET(#{limit})" unless offset.nil?
      connection.connect do |peer|