当前位置:网站首页>Es learning

Es learning

2022-06-25 10:31:00 leon__ k

1、 Pit encountered during installation

install ES:

  1. It needs to be closed in the configuration ssl verification
  2. There is information such as printing password during installation , Can copy , It can also be used. elasticsearch-reset-password.bat Reset password

install kibana:

  1. Need configuration es Address
  2. Prompt no login , Configured account password , Then prompt that it cannot be used elastic account number , It can be used token, use elasticsearch-service-tokens.bat Got token, Start successfully after configuration ( To obtain an account, you need to be elastic/kibana Namespace It can't be elastic/fleet-server Of )

2、 brief introduction

Introduction reference :
 Insert picture description here

3、 Easy to use

check : Example
Change : Example

// link 
$e = \Elasticsearch\ClientBuilder::create()
->setBasicAuthentication('elastic', ' password ')		// User name, password 
//->setApiKey() //api Sign in ( user name 2 choose 1)
->setHosts(['127.0.0.1:9200'])			// Change port 
->build();

// Version information 
$elastic = $e->info();
// Index exists 
$e->indices()->exists(['index' => 'k']);
// Create a simple index 
$e->indices()->create(['index' => 'k']);
// Get index map 
$e->indices()->getMapping(['index' => 'k']);
// Update index mapping 
$client->update($params);
// increase 
$e->index(['index' => 'k', 'body' => ['dd' => date('Y-m-d H:i:s')]])
//ID Just check 
$e->get(['index' => 'k', 'id' => 'PbudUYEBuG61Ky6oi7Pk'])
// Fuzzy query 
$params = [
    'index' => 'k',
    'body' => [
        'query' => [
            'match' => [
                'dd' => '2022'
            ]
        ]
    ]
];
$e->search($params);
// Change 
$params = [
     'index' => 'k',
     'id' => 'P7vCUYEBuG61Ky6otrO5',
     'body' => [
         'doc' => [
             'dd' => '2022'
         ]
     ]
 ];
 $e->update($params);
// Delete 
$e->deleteByQuery($params);
// Delete index 
$e->indices()->delete(['index' => 'k']);
原网站

版权声明
本文为[leon__ k]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251008046185.html