OP_TYPE_CREATE
OP_TYPE_CREATE
Single document stored in elastic search.
This function can be used to handle params for queries, filter
$_upsert : \Elastica\Document
setType(\Elastica\Type|string $type) : $this
Sets the document type name.
\Elastica\Type|string | $type | Type name |
setIndex(\Elastica\Index|string $index) : $this
Sets the document index name.
\Elastica\Index|string | $index | Index name |
None found |
None found |
setRouting(string $value) : $this
Set routing query param.
string | $value | routing |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
setUpsert(\Elastica\Document|array $data) : $this
\Elastica\Document|array | $data |
None found |
getUpsert() : \Elastica\Document
None found |
None found |
getOptions(array $fields = array(), boolean $withUnderscore = false) : array
array | $fields | if empty array all options will be returned, field names can be either with underscored either without, i.e. _percolate, routing |
boolean | $withUnderscore | should option keys contain underscore prefix |
None found |
setParam(string $key, mixed $value) : $this
Sets (overwrites) the value at the given key.
string | $key | Key to set |
mixed | $value | Key Value |
None found |
setParams(array $params) : $this
Sets (overwrites) all params of this object.
array | $params | Parameter list |
None found |
addParam(string $key, mixed $value) : $this
Adds a param to the list.
This function can be used to add an array of params
string | $key | Param key |
mixed | $value | Value to set |
None found |
getParam(string $key) : mixed
Returns a specific param.
string | $key | Key to return |
If requested key is not set
Key value
None found |
hasParam(string $key) : boolean
Test if a param is set.
string | $key | Key to test |
True if the param is set, false otherwise
None found |
None found |
__construct(integer|string $id = '', array|string $data = array(), \Elastica\Type|string $type = '', \Elastica\Index|string $index = '')
Creates a new document.
integer|string | $id | OPTIONAL $id Id is create if empty |
array|string | $data | OPTIONAL Data array |
\Elastica\Type|string | $type | OPTIONAL Type name |
\Elastica\Index|string | $index | OPTIONAL Index name |
None found |
get(string $key) : mixed
string | $key |
None found |
set(string $key, mixed $value) : $this
string | $key | |
mixed | $value |
None found |
remove(string $key) : $this
string | $key |
None found |
add(string $key, mixed $value) : $this
Adds the given key/value pair to the document.
string | $key | Document entry key |
mixed | $value | Document entry value |
None found |
addFile(string $key, string $filepath, string $mimeType = '') : $this
Adds a file to the index.
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: http://tika.apache.org/0.7/formats.html
string | $key | Key to add the file to |
string | $filepath | Path to add the file |
string | $mimeType | OPTIONAL Header mime type |
None found |
addFileContent(string $key, string $content) : $this
Add file content.
string | $key | Document key |
string | $content | Raw file content |
None found |
addGeoPoint(string $key, float $latitude, float $longitude) : $this
Adds a geopoint to the document.
Geohashes are not yet supported
string | $key | Field key |
float | $latitude | Latitude value |
float | $longitude | Longitude value |
None found |
setData(array|string $data) : $this
Overwrites the current document data with the given data.
array|string | $data | Data array |
None found |
None found |
setScript(\Elastica\Script\Script $data)
\Elastica\Script\Script | $data |
None found |
None found |
None found |
None found |
setAutoPopulate(boolean $autoPopulate = true) : $this
boolean | $autoPopulate |
None found |
create(array|\Elastica\Document $data) : self
array|\Elastica\Document | $data |
None found |
_convertArrayable(array $array) : array
Cast objects to arrays.
array | $array |
None found |
_getBaseName() : string
Param's name Picks the last part of the class name and makes it snake_case You can override this method if you want to change the name.
name
None found |
_setRawParam(string $key, mixed $value) : $this
Sets params not inside params array.
string | $key | |
mixed | $value |
None found |