Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def fulltext_index
  2. attributes.except(:_rev, :_type, :doc_type).values.map{|e| e.class==String ? e.to_s : ""}.join(" ").strip + " " + sequence.to_s
  3. end
  4.  
  5. index({ fulltext_index: "text"})
  6.  
  7. client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'music')
  8. client[:bands].indexes.create_one( { "$**": "text" } )
  9.  
  10. client = Mongoid.default_client[Model.collection_name]
  11. client.indexes.create_one( { "$**" => "text" } )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement