text() public method

The $language option may be set with {@link Expr::language()}.
See also: Builder::text()
See also: http://docs.mongodb.org/master/reference/operator/query/text/
public text ( string $search )
$search string
Example #1
0
 public function testLanguageWithText()
 {
     $expr = new Expr();
     $expr->text('foo');
     $this->assertSame($expr, $expr->language('en'));
     $this->assertEquals(array('$text' => array('$search' => 'foo', '$language' => 'en')), $expr->getQuery());
 }
Example #2
0
 public function testDiacriticSensitiveFalseRemovesOption()
 {
     $expr = new Expr();
     $expr->text('foo');
     $expr->diacriticSensitive(true);
     $expr->diacriticSensitive(false);
     $this->assertEquals(array('$text' => array('$search' => 'foo')), $expr->getQuery());
 }
Example #3
0
 /**
  * Specify $text criteria for the current field.
  *
  * The $language option may be set with {@link Builder::language()}.
  *
  * @see Expr::text()
  * @see http://docs.mongodb.org/master/reference/operator/query/text/
  * @param string $search
  * @return self
  */
 public function text($search)
 {
     $this->expr->text($search);
     return $this;
 }
Example #4
0
 /**
  * Specify $text criteria for the current field.
  *
  * The $language option may be set with {@link Builder::language()}.
  *
  * You can only use this in the first $match stage of a pipeline.
  *
  * @see Expr::text()
  * @see http://docs.mongodb.org/master/reference/operator/query/text/
  * @param string $search
  * @return $this
  */
 public function text($search)
 {
     $this->query->text($search);
     return $this;
 }