@@ 82-92 (lines=11) @@ | ||
79 | return $models; |
|
80 | } |
|
81 | ||
82 | public function insert(Storable $model) |
|
83 | { |
|
84 | $collection = new ElasticsearchCollectionParser($model->getCollection()); |
|
85 | $params = [ |
|
86 | 'index' => $collection->getIndex(), |
|
87 | 'type' => $collection->getType(), |
|
88 | 'id' => $model->getPrimaryKey(), |
|
89 | 'body' => $model->toArray() |
|
90 | ]; |
|
91 | $this->client->index($params); |
|
92 | } |
|
93 | ||
94 | public function update(Storable $model) |
|
95 | { |
|
@@ 94-104 (lines=11) @@ | ||
91 | $this->client->index($params); |
|
92 | } |
|
93 | ||
94 | public function update(Storable $model) |
|
95 | { |
|
96 | $collection = new ElasticsearchCollectionParser($model->getCollection()); |
|
97 | $params = [ |
|
98 | 'index' => $collection->getIndex(), |
|
99 | 'type' => $collection->getType(), |
|
100 | 'id' => $model->getPrimaryKey(), |
|
101 | 'body' => $model->toArray() |
|
102 | ]; |
|
103 | $this->client->index($params); |
|
104 | } |
|
105 | ||
106 | public function delete(Storable $model) |
|
107 | { |
|
@@ 106-115 (lines=10) @@ | ||
103 | $this->client->index($params); |
|
104 | } |
|
105 | ||
106 | public function delete(Storable $model) |
|
107 | { |
|
108 | $collection = new ElasticsearchCollectionParser($model->getCollection()); |
|
109 | $params = [ |
|
110 | 'index' => $collection->getIndex(), |
|
111 | 'type' => $collection->getType(), |
|
112 | 'id' => $model->getPrimaryKey() |
|
113 | ]; |
|
114 | $this->client->delete($params); |
|
115 | } |
|
116 | } |