I index about 1,000,000 rows with elasticsearch and now want to index some other rows, but this error occurs:
Fatal error: Uncaught Elasticsearch\Common\Exceptions\RuntimeException: index is required for Index in C:\wamp64\www\myProject...\elastic\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Endpoints\Index.php on line 55
I write php and this is my code:
<?php
/*
* index document module
*/
public function insert_node ($id) {
// 1 - set connection
// code
// 2 - get data from mysql query
// code
// 3 - assign data to $row array in foreach
// code
// 4 - set $params array for index
$params['body'][] = [
'_index' => 'users',
'_type' => 'user'
];
$params['body'][] = [
'id' => $row['id'],
'name' => $row['name'],
'phone' => $row['phone'],
'province' => $row['province'],
'credit' => $row['credit'],
...
];
// 5 - index data
$responses = $client -> index ($params);
}