mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
28 lines
459 B
PHP
28 lines
459 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
|
|
|
class TextNode extends Node
|
|
{
|
|
protected $text;
|
|
|
|
public function __construct($text)
|
|
{
|
|
$this->text = $text;
|
|
}
|
|
|
|
public function getQuery($field = '_all')
|
|
{
|
|
return array(
|
|
'match' => array(
|
|
$field => $this->text
|
|
)
|
|
);
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('"%s"', $this->text);
|
|
}
|
|
}
|