Last active
December 18, 2015 03:29
-
-
Save cpatrick/5719037 to your computer and use it in GitHub Desktop.
Enabling Mongo full-text search and building an index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// enable text search | |
db.adminCommand( { setParameter : 1, textSearchEnabled : true } ) | |
// build canepi-specific indices | |
db.healthmap.ensureIndex({"properties.summary": "text", | |
"properties.descr": "text", | |
"properties.country": "text", | |
"properties.disease": "text"}, | |
{ weights: { "properties.summary": 10, | |
"properties.descr": 5, | |
"properties.disease": 10, | |
"properties.country":10}, | |
name: "TextIndex"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment