# File lib/padrino-contrib/orm/mongo_mapper/search.rb, line 25 def search(text, options={}) if text re = Regexp.new(Regexp.escape(text), 'i') where = @_search_fields.map { |field| "this.#{field}.match(#{re.inspect})" }.join(" || ") options.merge!("$where" => where) end options.delete(:paginate) ? paginate(options) : all(options) end