We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
my config
<?php return [ # Here you can define the default connection name. 'default'=>env('ELASTIC_CONNECTION', 'default'), # Here you can define your connections. 'connections'=>[ 'default'=>[ 'servers'=>[ [ "host"=>env("ELASTIC_HOST", "127.0.0.1"), "port"=>env("ELASTIC_PORT", 9200), 'user'=>env('ELASTIC_USER', ''), 'pass'=>env('ELASTIC_PASS', ''), 'scheme'=>env('ELASTIC_SCHEME', 'http'), ] ], // Custom handlers // 'handler' => new MyCustomHandler(), 'index'=>env('ELASTIC_INDEX', 'orders') ] ], /** * es为兼容后期版本,一个index最多有一个type */ 'indices'=>[ //index 'orders'=>[ 'settings'=>[ "number_of_shards"=>1, "number_of_replicas"=>0, 'max_result_window'=>50000,// ], 'mappings'=>[ //type->orders 'orders'=>[ 'properties'=>[ 'id'=>[ 'type'=>'keyword', ], 'username'=>[ 'type'=>'keyword', ], 'phone'=>[ 'type'=>'keyword', ], ] ], ] ], //index 'product_public'=>[ 'settings'=>[ "number_of_shards"=>1, "number_of_replicas"=>0, ], 'mappings'=>[ //type->products 'products'=>[ 'properties'=>[ 'product_code'=>[ 'type'=>'keyword', ], 'product_name'=>[ 'type'=>'text' ], ] ] ] ] ] ];
first create index
then I want add two tables' data to elasticsearch
$orders=Order::query()->get(['id', 'username', 'phone'])->toArray(); $this->info('order count is'.count($orders));; ES::index('orders')->type("orders")->bulk($orders); dump('orders added');//Don't run $products=ProductPublic::query()->get(['product_code', 'product_name'])->toArray(); $this->info('product count is'.count($products));; ES::index('product_public')->type("products")->bulk($products); dump('product add');
after run
index of product_public is empty?
elasticsearch vsersion is 6.8.1
composer.json "basemkhirat/elasticsearch": "^1.4",
The text was updated successfully, but these errors were encountered:
No branches or pull requests
my config
first create index
then I want add two tables' data to elasticsearch
after run
index of product_public is empty?
elasticsearch vsersion is 6.8.1
composer.json
"basemkhirat/elasticsearch": "^1.4",
The text was updated successfully, but these errors were encountered: