Mongodb 如何在Doctrine Mongo DB中使用$search$文本?
如何使用条令查询生成器构建下面的本机mongo db查询Mongodb 如何在Doctrine Mongo DB中使用$search$文本?,mongodb,symfony,doctrine-orm,Mongodb,Symfony,Doctrine Orm,如何使用条令查询生成器构建下面的本机mongo db查询 db.Product.find({ $text: {$search: 'CaSe InSEnsitive'}, title: {$regex:/^CaSe InSEnsitive$/i} }); 通过使用文本搜索索引,此查询将加速不区分大小写的搜索 $expr = $query->expr()->operator('$text', array( '$search' => $par
db.Product.find({
$text: {$search: 'CaSe InSEnsitive'},
title: {$regex:/^CaSe InSEnsitive$/i}
});
通过使用文本搜索索引,此查询将加速不区分大小写的搜索
$expr = $query->expr()->operator('$text', array(
'$search' => $param['title'],
'$language' => 'en', // or one of those other languages
));
$query->field(null)->equals($expr->getQuery());