PHP 트레잇 Elasticquent\ElasticquentTrait

Functionality extensions for Elequent that makes working with Elasticsearch easier.
상속: use trait elasticquent\ElasticquentClientTrait
파일 보기 프로젝트 열기: elasticquent/elasticquent

보호된 프로퍼티들

프로퍼티 타입 설명
$documentScore null | integer Hit score when using data from Elasticsearch results.
$documentVersion null | integer Elasticsearch document version.
$isDocument boolean Set to true when our model is populated by a
$usesTimestampsInIndex boolean Uses Timestamps In Index

공개 메소드들

메소드 설명
addAllToIndex ( ) : array Index Documents
addToIndex ( ) : array Add to Search Index
complexSearch ( $params ) : elasticquent\ElasticquentResultCollection Perform a "complex" or custom search.
createIndex ( integer $shards = null, integer $replicas = null ) : array Create Index
deleteIndex ( ) : array Delete Index
deleteMapping ( ) : array Delete Mapping
documentScore ( ) : null | float Get Document Score
documentVersion ( ) : null | integer Document Version
dontUseTimestampsInIndex ( ) Don't Use Timestamps In Index.
getBasicEsParams ( boolean $getIdIfPossible = true, boolean $getSourceIfPossible = false, boolean $getTimestampIfPossible = false, integer $limit = null, integer $offset = null ) : array Get Basic Elasticsearch Params
getIndexDocumentData ( ) : array Get Index Document Data
getIndexSettings ( ) : array Get Index Settings
getIndexedDocument ( ) : array Get Search Document
getMapping ( ) : void Get Mapping
getMappingProperties ( ) : array Get Mapping Properties
getTypeName ( ) : string Get Type Name
hydrateElasticquentResult ( array $items, array $meta = null ) : Elasticquent\ElasticquentResultCollection Create a elacticquent result collection of models from plain arrays.
hydrateElasticsearchResult ( array $result ) : Elasticquent\ElasticquentResultCollection Create a elacticquent result collection of models from plain elasticsearch result.
hydrateRecursive ( Model $model, array $items, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : Illuminate\Database\Eloquent\Collection Create a collection of models from plain arrays recursive.
isDocument ( ) : boolean Is Elasticsearch Document
loadPivotAttribute ( Model $model, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) Get the pivot attribute from a model.
loadRelationsAttributesRecursive ( Model $model ) Get the relations attributes from a model.
mappingExists ( ) : boolean Mapping Exists
newCollection ( array $models = [] ) : ElasticquentCollection New Collection
newElasticquentResultCollection ( array $models = [], array $meta = null ) : Elasticquent\ElasticquentResultCollection Create a new Elasticquent Result Collection instance.
newFromBuilderRecursive ( Model $model, array $attributes = [], Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : static Create a new model instance that is existing recursive.
newFromHitBuilder ( array $hit = [] ) : static New From Hit Builder
putMapping ( boolean $ignoreConflicts = false ) : array Put Mapping.
rebuildMapping ( ) : array Rebuild Mapping
reindex ( ) : array Re-Index All Content
removeFromIndex ( ) : array Remove From Search Index
search ( string $term = '' ) : elasticquent\ElasticquentResultCollection Search
searchByQuery ( array $query = null, array $aggregations = null, array $sourceFields = null, integer $limit = null, integer $offset = null, array $sort = null ) : elasticquent\ElasticquentResultCollection Search By Query
setMappingProperties ( array $mapping = null ) Set Mapping Properties
typeExists ( ) : boolean Type Exists.
updateIndex ( ) : array Partial Update to Indexed Document
useTimestampsInIndex ( $shouldUse = true ) Use Timestamps In Index.
usesTimestampsInIndex ( ) Uses Timestamps In Index.

비공개 메소드들

메소드 설명
buildFieldsParameter ( boolean $getSourceIfPossible, boolean $getTimestampIfPossible ) : array Build the 'fields' parameter depending on given options.
isMultiLevelArray ( array $array ) : boolean Check if an array is multi-level array like [[id], [id], [id]].

메소드 상세

addAllToIndex() 공개 정적인 메소드

Index all documents in an Eloquent model.
public static addAllToIndex ( ) : array
리턴 array

addToIndex() 공개 메소드

Add to Search Index
public addToIndex ( ) : array
리턴 array

complexSearch() 공개 정적인 메소드

Using this method, a custom query can be sent to Elasticsearch.
public static complexSearch ( $params ) : elasticquent\ElasticquentResultCollection
$params parameters to be passed directly to Elasticsearch
리턴 elasticquent\ElasticquentResultCollection

createIndex() 공개 정적인 메소드

Create Index
public static createIndex ( integer $shards = null, integer $replicas = null ) : array
$shards integer
$replicas integer
리턴 array

deleteIndex() 공개 정적인 메소드

Delete Index
public static deleteIndex ( ) : array
리턴 array

deleteMapping() 공개 정적인 메소드

Delete Mapping
public static deleteMapping ( ) : array
리턴 array

documentScore() 공개 메소드

Get Document Score
public documentScore ( ) : null | float
리턴 null | float

documentVersion() 공개 메소드

Document Version
public documentVersion ( ) : null | integer
리턴 null | integer

dontUseTimestampsInIndex() 공개 메소드

Don't Use Timestamps In Index.
사용 중단:

getBasicEsParams() 공개 메소드

Most Elasticsearch API calls need the index and type passed in a parameter array.
public getBasicEsParams ( boolean $getIdIfPossible = true, boolean $getSourceIfPossible = false, boolean $getTimestampIfPossible = false, integer $limit = null, integer $offset = null ) : array
$getIdIfPossible boolean
$getSourceIfPossible boolean
$getTimestampIfPossible boolean
$limit integer
$offset integer
리턴 array

getIndexDocumentData() 공개 메소드

Get the data that Elasticsearch will index for this particular document.
public getIndexDocumentData ( ) : array
리턴 array

getIndexSettings() 공개 메소드

Get Index Settings
public getIndexSettings ( ) : array
리턴 array

getIndexedDocument() 공개 메소드

Retrieve an ElasticSearch document for this entity.
public getIndexedDocument ( ) : array
리턴 array

getMapping() 공개 정적인 메소드

Get Mapping
public static getMapping ( ) : void
리턴 void

getMappingProperties() 공개 메소드

Get Mapping Properties
public getMappingProperties ( ) : array
리턴 array

getTypeName() 공개 메소드

Get Type Name
public getTypeName ( ) : string
리턴 string

hydrateElasticquentResult() 공개 정적인 메소드

Create a elacticquent result collection of models from plain arrays.
public static hydrateElasticquentResult ( array $items, array $meta = null ) : Elasticquent\ElasticquentResultCollection
$items array
$meta array
리턴 Elasticquent\ElasticquentResultCollection

hydrateElasticsearchResult() 공개 정적인 메소드

Create a elacticquent result collection of models from plain elasticsearch result.
public static hydrateElasticsearchResult ( array $result ) : Elasticquent\ElasticquentResultCollection
$result array
리턴 Elasticquent\ElasticquentResultCollection

hydrateRecursive() 공개 정적인 메소드

Create a collection of models from plain arrays recursive.
public static hydrateRecursive ( Model $model, array $items, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : Illuminate\Database\Eloquent\Collection
$model Illuminate\Database\Eloquent\Model
$items array
$parentRelation Illuminate\Database\Eloquent\Relations\Relation
리턴 Illuminate\Database\Eloquent\Collection

isDocument() 공개 메소드

Is the data in this module sourced from an Elasticsearch document source?
public isDocument ( ) : boolean
리턴 boolean

loadPivotAttribute() 공개 정적인 메소드

Get the pivot attribute from a model.
public static loadPivotAttribute ( Model $model, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null )
$model Illuminate\Database\Eloquent\Model
$parentRelation Illuminate\Database\Eloquent\Relations\Relation

loadRelationsAttributesRecursive() 공개 정적인 메소드

Get the relations attributes from a model.
public static loadRelationsAttributesRecursive ( Model $model )
$model Illuminate\Database\Eloquent\Model

mappingExists() 공개 정적인 메소드

Mapping Exists
public static mappingExists ( ) : boolean
리턴 boolean

newCollection() 공개 메소드

New Collection
public newCollection ( array $models = [] ) : ElasticquentCollection
$models array
리턴 ElasticquentCollection

newElasticquentResultCollection() 공개 메소드

Create a new Elasticquent Result Collection instance.
public newElasticquentResultCollection ( array $models = [], array $meta = null ) : Elasticquent\ElasticquentResultCollection
$models array
$meta array
리턴 Elasticquent\ElasticquentResultCollection

newFromBuilderRecursive() 공개 정적인 메소드

Create a new model instance that is existing recursive.
public static newFromBuilderRecursive ( Model $model, array $attributes = [], Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : static
$model Illuminate\Database\Eloquent\Model
$attributes array
$parentRelation Illuminate\Database\Eloquent\Relations\Relation
리턴 static

newFromHitBuilder() 공개 메소드

Variation on newFromBuilder. Instead, takes
public newFromHitBuilder ( array $hit = [] ) : static
$hit array
리턴 static

putMapping() 공개 정적인 메소드

Put Mapping.
public static putMapping ( boolean $ignoreConflicts = false ) : array
$ignoreConflicts boolean
리턴 array

rebuildMapping() 공개 정적인 메소드

This will delete and then re-add the mapping for this model.
public static rebuildMapping ( ) : array
리턴 array

reindex() 공개 정적인 메소드

Re-Index All Content
public static reindex ( ) : array
리턴 array

removeFromIndex() 공개 메소드

Remove From Search Index
public removeFromIndex ( ) : array
리턴 array

searchByQuery() 공개 정적인 메소드

Search with a query array
public static searchByQuery ( array $query = null, array $aggregations = null, array $sourceFields = null, integer $limit = null, integer $offset = null, array $sort = null ) : elasticquent\ElasticquentResultCollection
$query array
$aggregations array
$sourceFields array
$limit integer
$offset integer
$sort array
리턴 elasticquent\ElasticquentResultCollection

setMappingProperties() 공개 메소드

Set Mapping Properties
public setMappingProperties ( array $mapping = null )
$mapping array

typeExists() 공개 정적인 메소드

Does this type exist?
public static typeExists ( ) : boolean
리턴 boolean

updateIndex() 공개 메소드

Partial Update to Indexed Document
public updateIndex ( ) : array
리턴 array

useTimestampsInIndex() 공개 메소드

Use Timestamps In Index.
public useTimestampsInIndex ( $shouldUse = true )

usesTimestampsInIndex() 공개 메소드

Uses Timestamps In Index.

프로퍼티 상세

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

Hit score when using data from Elasticsearch results.
protected null|int $documentScore
리턴 null | integer

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

Elasticsearch document version.
protected null|int $documentVersion
리턴 null | integer

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

Set to true when our model is populated by a
protected bool $isDocument
리턴 boolean

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

Uses Timestamps In Index
protected bool $usesTimestampsInIndex
리턴 boolean