PHP 클래스 Elastica\Document

저자: Nicolas Ruflin ([email protected])
상속: extends AbstractUpdateAction
파일 보기 프로젝트 열기: ruflin/elastica 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_autoPopulate boolean
$_data Document data.
$_docAsUpsert boolean Whether to use this document to upsert if the document does not exist.

공개 메소드들

메소드 설명
__construct ( integer | string $id = '', array | string $data = [], Type | string $type = '', Index | string $index = '' ) Creates a new document.
__get ( string $key ) : mixed
__isset ( string $key ) : boolean
__set ( string $key, mixed $value )
__unset ( string $key )
addFile ( string $key, string $filepath, string $mimeType = '' ) Adds a file to the index.
addFileContent ( string $key, string $content ) Add file content.
addGeoPoint ( string $key, float $latitude, float $longitude ) Adds a geopoint to the document.
create ( array | Document $data ) : self
get ( string $key ) : mixed
getData ( ) : array | string Returns the document data.
getDocAsUpsert ( ) : boolean
has ( string $key ) : boolean
isAutoPopulate ( ) : boolean
remove ( string $key )
set ( string $key, mixed $value )
setAutoPopulate ( boolean $autoPopulate = true )
setData ( array | string $data ) Overwrites the current document data with the given data.
setDocAsUpsert ( boolean $value )
toArray ( ) : array Returns the document as an array.

메소드 상세

__construct() 공개 메소드

Creates a new document.
public __construct ( integer | string $id = '', array | string $data = [], Type | string $type = '', Index | string $index = '' )
$id integer | string OPTIONAL $id Id is create if empty
$data array | string OPTIONAL Data array
$type Type | string OPTIONAL Type name
$index Index | string OPTIONAL Index name

__get() 공개 메소드

public __get ( string $key ) : mixed
$key string
리턴 mixed

__isset() 공개 메소드

public __isset ( string $key ) : boolean
$key string
리턴 boolean

__set() 공개 메소드

public __set ( string $key, mixed $value )
$key string
$value mixed

__unset() 공개 메소드

public __unset ( string $key )
$key string

addFile() 공개 메소드

To use this feature you have to call the following command in the elasticsearch directory: ./bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.6.0 This installs the tika file analysis plugin. More infos about supported formats can be found here: {@link http://tika.apache.org/0.7/formats.html}
public addFile ( string $key, string $filepath, string $mimeType = '' )
$key string Key to add the file to
$filepath string Path to add the file
$mimeType string OPTIONAL Header mime type

addFileContent() 공개 메소드

Add file content.
public addFileContent ( string $key, string $content )
$key string Document key
$content string Raw file content

addGeoPoint() 공개 메소드

Geohashes are not yet supported
public addGeoPoint ( string $key, float $latitude, float $longitude )
$key string Field key
$latitude float Latitude value
$longitude float Longitude value

create() 공개 정적인 메소드

public static create ( array | Document $data ) : self
$data array | Document
리턴 self

get() 공개 메소드

public get ( string $key ) : mixed
$key string
리턴 mixed

getData() 공개 메소드

Returns the document data.
public getData ( ) : array | string
리턴 array | string Document data

getDocAsUpsert() 공개 메소드

public getDocAsUpsert ( ) : boolean
리턴 boolean

has() 공개 메소드

public has ( string $key ) : boolean
$key string
리턴 boolean

isAutoPopulate() 공개 메소드

public isAutoPopulate ( ) : boolean
리턴 boolean

remove() 공개 메소드

public remove ( string $key )
$key string

set() 공개 메소드

public set ( string $key, mixed $value )
$key string
$value mixed

setAutoPopulate() 공개 메소드

public setAutoPopulate ( boolean $autoPopulate = true )
$autoPopulate boolean

setData() 공개 메소드

Overwrites the current document data with the given data.
public setData ( array | string $data )
$data array | string Data array

setDocAsUpsert() 공개 메소드

public setDocAsUpsert ( boolean $value )
$value boolean

toArray() 공개 메소드

Returns the document as an array.
public toArray ( ) : array
리턴 array

프로퍼티 상세

$_autoPopulate 보호되어 있는 프로퍼티

protected bool $_autoPopulate
리턴 boolean

$_data 보호되어 있는 프로퍼티

Document data.
protected $_data

$_docAsUpsert 보호되어 있는 프로퍼티

Whether to use this document to upsert if the document does not exist.
protected bool $_docAsUpsert
리턴 boolean