PHP Class Phosphorum\Search\Indexer

This component uses ElasticSearch to search items in the forum
Afficher le fichier Open project: phalcon/forum Class Usage Examples

Protected Properties

Свойство Type Description
$client Elasticsearch\Client Elasticsearch client
$config Phalcon\Config Indexer config
$logger Phalcon\Logger\AdapterInterface Application logger

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
createPostArray ( Posts $post )
doIndex ( Posts $post ) Index a single document
parseElasticResponse ( mixed $response ) : array Parse Elasticsearch response

Method Details

__construct() public méthode

public __construct ( )

createPostArray() protected méthode

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

doIndex() protected méthode

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

index() public méthode

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

indexAll() public méthode

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

parseElasticResponse() protected méthode

Parse Elasticsearch response
protected parseElasticResponse ( mixed $response ) : array
$response mixed
Résultat array

Property Details

$client protected_oe property

Elasticsearch client
protected Client,Elasticsearch $client
Résultat Elasticsearch\Client

$config protected_oe property

Indexer config
protected Config,Phalcon $config
Résultat Phalcon\Config

$logger protected_oe property

Application logger
protected AdapterInterface,Phalcon\Logger $logger
Résultat Phalcon\Logger\AdapterInterface