Saturday, 7 September 2013

mongodb full text search index all fields vs index one field

mongodb full text search index all fields vs index one field

Currently lastest MongoDB stable version is v2.4.6, full text search is in
beta state.
Which one will be faster:
1) To create one field named "text" and extract all text info from all
other fields and concatenate them into field - "text" and index that field
("text")
So that will look like
db.collection.ensureIndex( { "text": "text" } );
2) Just index all fields:
db.collection.ensureIndex( { "$**": "text" } );
Which one is better in performance and in disk storage requirements?

No comments:

Post a Comment