PHP Class Cake\ElasticSearch\Document

Inheritance: implements Cake\Datasource\EntityInterface, use trait Cake\Datasource\EntityTrait
Datei anzeigen Open project: cakephp/elastic-search

Protected Properties

Property 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.

Public Methods

Method 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 method

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 method

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
return array

highlights() public method

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
return array

type() public method

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

version() public method

If this is a new document, this function returns 1
public version ( ) : integer
return 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
return Elastica\Result