Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fulltext_index
- attributes.except(:_rev, :_type, :doc_type).values.map{|e| e.class==String ? e.to_s : ""}.join(" ").strip + " " + sequence.to_s
- end
- index({ fulltext_index: "text"})
- client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'music')
- client[:bands].indexes.create_one( { "$**": "text" } )
- client = Mongoid.default_client[Model.collection_name]
- client.indexes.create_one( { "$**" => "text" } )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement