I'm trying to do a full text search on a collection, but in order to do that I need to create a text index (http://docs.mongodb.org/manual/tutorial/create-text-index-on-multiple-fields/)
The mgo library provides an EnsureIndex()
function however, it only accepts a slice of strings as a key. I tried just writing the index out as a string: { name: "text", about: "text" }
and passing it to that function but it didn't work.
I've also managed to manually create the index in the mongo shell but I'd really like to have the index documented in my go project. Is this possible? Thanks in advance!