$mongodb = Yii::$app->mongodb;
$cursor = $mongodb->getCollection($table);
$cursor->mongoCollection->ensureIndex(
[
'name' => 'text',
'description' => 'text',
],
[
'weights' => [
'name' => 10,
'description' => 5,
],
'default_language'=>$store,
]
);
db.getCollection("product_flat").ensureIndex({
"name.name_en":"text",
"description.description_en":"text"
},
{
"weights":{
"name.name_en":10,
"description.description_en":5
},
"default_language":"english",
}
);