How to search in fulltext index using php in mongodb -


i'm using mongodb 2.4 , added fulltext index "title" field in 1 collection. how should search in field using php?

this code use right now:

$params = array(         '_id' => array(             '$gt' => (int)$gt         )     ); $r = $this->collection->find( $params )->limit($limit); 

this seem answer question:

<?php $result = $db->command(     array(         'text' => 'bar', //this name of collection searching         'search' => 'hotel', //the string search         'limit' => 5, //the number of results, default 1000         'project' => array( //the fields retrieve db             'title' => 1         )     ) ); 

http://www.php.net/manual/en/mongodb.command.php#111891


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -