Giter VIP home page Giter VIP logo

Comments (3)

54554980 avatar 54554980 commented on July 19, 2024

再次测试如下
代码如下:
$bean = new \EasySwoole\ElasticSearch\RequestBean\Bulk();
$bean->setIndex('log_web');
$bean->setType('log'); //增加类型测试
$body = [];
for ($i = 1; $i <= 5; $i++) {
$body[] = [
'create' => [
'_index' => 'my-index',
'_type' => 'my-type',
'_id' => $i * 1000
]
];
$body[] = [
'test-field' => 'test-data',
];
}
$bean->setBody($body);
$response = $elasticsearch->client()->bulk($bean)->getBody();
$response = $elasticsearch->client()->get($bean)->getBody();*/
var_dump(json_decode($response, true));

提示错误如下:
[2021-06-21 09:33:38][trigger][notice]:[Specifying types in urls has been deprecated at file:/easyswoole/vendor/easyswoole/elasticsearch/src/Endpoints/Bulk.php line:22]
图片

from elasticsearch.

523013183 avatar 523013183 commented on July 19, 2024

Trying to access array offset on value of type null at file:vendor/jeremeamia/superclosure/src/SerializableClosure.php(210) : eval()'d code line:14
我也是返回null

elastic: 7.9.2
swoole version 4.4.26
php version 7.4.12
easy swoole 3.3.4

不加 x-pack 登录验证时,是正常的。

$config = new Config([
    'host' => '192.168.2.78',
    'port' => 9200,
    'username' => 'elastic',
    'password' => '123456'
]);
$elasticsearch = new ElasticSearch($config);

$bean = new \EasySwoole\ElasticSearch\RequestBean\Count();
$response = $elasticsearch->client()->count($bean)->getBody();
$response = json_decode($response, true);
var_dump($response['count']);

from elasticsearch.

523013183 avatar 523013183 commented on July 19, 2024

Trying to access array offset on value of type null at file:vendor/jeremeamia/superclosure/src/SerializableClosure.php(210) : eval()'d code line:14
我也是返回null

elastic: 7.9.2
swoole version 4.4.26
php version 7.4.12
easy swoole 3.3.4

不加 x-pack 登录验证时,是正常的。

$config = new Config([
    'host' => '192.168.2.78',
    'port' => 9200,
    'username' => 'elastic',
    'password' => '123456'
]);
$elasticsearch = new ElasticSearch($config);

$bean = new \EasySwoole\ElasticSearch\RequestBean\Count();
$response = $elasticsearch->client()->count($bean)->getBody();
$response = json_decode($response, true);
var_dump($response['count']);

知道了, es就开启了本机访问,开启全网访问就正常了。

from elasticsearch.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.