diff --git a/import_db.sh b/import_db.sh index c150641..c852afd 100755 --- a/import_db.sh +++ b/import_db.sh @@ -3,4 +3,4 @@ # We use the env vars provided in compose to authenticate mongorestore --username "$MONGO_INITDB_ROOT_USERNAME" --password "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin --archive=openfoodfacts-mongodbdump.gz --gzip mongosh --username "$MONGO_INITDB_ROOT_USERNAME" --password "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin "mongodb://localhost:27017/off" --eval 'db.products.dropIndexes()' -mongosh --username "$MONGO_INITDB_ROOT_USERNAME" --password "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin "mongodb://localhost:27017/off" --eval 'db.products.createIndex({ _keywords: "text", product_name: "text" }, { name: "TextSearchIndex" });' +mongosh --username "$MONGO_INITDB_ROOT_USERNAME" --password "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin "mongodb://localhost:27017/off" --eval 'db.products.createIndex({ _keywords: "text", product_name: "text" }, { weights: { product_name: 5, _keywords: 3}, name: "TextSearchIndex" });'