PHP Class Phosphorum\Search\Indexer

This component uses ElasticSearch to search items in the forum
Datei anzeigen Open project: phalcon/forum Class Usage Examples

Protected Properties

Property Type Description
$client Elasticsearch\Client Elasticsearch client
$config Phalcon\Config Indexer config
$logger Phalcon\Logger\AdapterInterface Application logger

Public Methods

Method 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

Protected Methods

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

Method Details

__construct() public method

public __construct ( )

createPostArray() protected method

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

doIndex() protected method

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

index() public method

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

indexAll() public method

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

parseElasticResponse() protected method

Parse Elasticsearch response
protected parseElasticResponse ( mixed $response ) : array
$response mixed
return array

Property Details

$client protected_oe property

Elasticsearch client
protected Client,Elasticsearch $client
return Elasticsearch\Client

$config protected_oe property

Indexer config
protected Config,Phalcon $config
return Phalcon\Config

$logger protected_oe property

Application logger
protected AdapterInterface,Phalcon\Logger $logger
return Phalcon\Logger\AdapterInterface