PHP Класс Phosphorum\Search\Indexer

This component uses ElasticSearch to search items in the forum
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$client Elasticsearch\Client Elasticsearch client
$config Phalcon\Config Indexer config
$logger Phalcon\Logger\AdapterInterface Application logger

Открытые методы

Метод Описание
__construct ( )
index ( Posts $post ) Puts a post in the search server
indexAll ( ) Indexes all posts in the forum in ES
search ( array $fields, integer $limit = 10, boolean $returnPosts = false ) : array Search documents in ElasticSearch by the specified criteria

Защищенные методы

Метод Описание
createPostArray ( Posts $post )
doIndex ( Posts $post ) Index a single document
parseElasticResponse ( mixed $response ) : array Parse Elasticsearch response

Описание методов

__construct() публичный Метод

public __construct ( )

createPostArray() защищенный Метод

protected createPostArray ( Posts $post )
$post Phosphorum\Models\Posts

doIndex() защищенный Метод

Index a single document
protected doIndex ( Posts $post )
$post Phosphorum\Models\Posts

index() публичный Метод

Puts a post in the search server
public index ( Posts $post )
$post Phosphorum\Models\Posts

indexAll() публичный Метод

Indexes all posts in the forum in ES
public indexAll ( )

parseElasticResponse() защищенный Метод

Parse Elasticsearch response
protected parseElasticResponse ( mixed $response ) : array
$response mixed
Результат array

Описание свойств

$client защищенное свойство

Elasticsearch client
protected Client,Elasticsearch $client
Результат Elasticsearch\Client

$config защищенное свойство

Indexer config
protected Config,Phalcon $config
Результат Phalcon\Config

$logger защищенное свойство

Application logger
protected AdapterInterface,Phalcon\Logger $logger
Результат Phalcon\Logger\AdapterInterface