mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
39 lines
656 B
PHP
39 lines
656 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($fields = ['_all'])
|
|
{
|
|
return array(
|
|
'multi_match' => array(
|
|
'fields' => $fields,
|
|
'query' => $this->text,
|
|
)
|
|
);
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('"%s"', $this->text);
|
|
}
|
|
|
|
public function isFullTextOnly()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function getText()
|
|
{
|
|
return $this->text;
|
|
}
|
|
}
|