PHP Class Cake\ElasticSearch\Document

Inheritance: implements Cake\Datasource\EntityInterface, use trait Cake\Datasource\EntityTrait
Afficher le fichier Open project: cakephp/elastic-search

Protected Properties

Свойство Type Description
$_result Elastica\Result Holds an instance of a Result object that's passed into the constructor from a search query. It can contain extra information about this document concerning the search operation, such as highlights, score and version.

Méthodes publiques

Méthode Description
__construct ( array | Result $data = [], array $options = [] ) Takes either an array or a Result object form a search and constructs a document representing an entity in a elastic search type,
explanation ( ) : array Returns the explanation array for this document as returned from ElasticSearch.
highlights ( ) : array Returns the highlights array for document as returned by ElasticSearch for the executed query.
type ( ) : string | null Returns the ElasticSearch type name from which this document came from.
version ( ) : integer Returns the version number of this document as returned by ElasticSearch

Method Details

__construct() public méthode

Takes either an array or a Result object form a search and constructs a document representing an entity in a elastic search type,
public __construct ( array | Result $data = [], array $options = [] )
$data array | Elastica\Result An array or Result object that represents an Elasticsearch document
$options array An array of options to set the state of the document

explanation() public méthode

If this is a new document, or the query used to create it did not ask for explanation, this function will return an empty array.
public explanation ( ) : array
Résultat array

highlights() public méthode

If this is a new document, or the query used to create it did not ask for highlights, this function will return an empty array.
public highlights ( ) : array
Résultat array

type() public méthode

If this is a new document, this function returns null
public type ( ) : string | null
Résultat string | null

version() public méthode

If this is a new document, this function returns 1
public version ( ) : integer
Résultat integer

Property Details

$_result protected_oe property

Holds an instance of a Result object that's passed into the constructor from a search query. It can contain extra information about this document concerning the search operation, such as highlights, score and version.
protected Result,Elastica $_result
Résultat Elastica\Result