当前位置:网站首页>ES 学习
ES 学习
2022-06-25 10:08:00 【leon__k】
1、安装遇到的坑
安装ES:
- 需要在配置关闭ssl验证
- 安装过程中有打印密码等信息,可以复制,也可以用elasticsearch-reset-password.bat重置密码
安装kibana:
- 需要配置es地址
- 提示没有登陆,配置了账号密码,然后提示不能用elastic账号,可以用token,用elasticsearch-service-tokens.bat获取了token,配置后启动成功(获取账号时需要是elastic/kibana命名空间的 不能是elastic/fleet-server的)
2、简介
3、简单使用
//链接
$e = \Elasticsearch\ClientBuilder::create()
->setBasicAuthentication('elastic', '密码') //用户名密码
//->setApiKey() //api登录(用户名2选1)
->setHosts(['127.0.0.1:9200']) //改端口
->build();
//版本信息
$elastic = $e->info();
//索引存在
$e->indices()->exists(['index' => 'k']);
//创建简单索引
$e->indices()->create(['index' => 'k']);
//获取索引映射
$e->indices()->getMapping(['index' => 'k']);
//更新索引影射
$client->update($params);
//增
$e->index(['index' => 'k', 'body' => ['dd' => date('Y-m-d H:i:s')]])
//ID单查
$e->get(['index' => 'k', 'id' => 'PbudUYEBuG61Ky6oi7Pk'])
//模糊查询
$params = [
'index' => 'k',
'body' => [
'query' => [
'match' => [
'dd' => '2022'
]
]
]
];
$e->search($params);
//改
$params = [
'index' => 'k',
'id' => 'P7vCUYEBuG61Ky6otrO5',
'body' => [
'doc' => [
'dd' => '2022'
]
]
];
$e->update($params);
//删
$e->deleteByQuery($params);
//删除索引
$e->indices()->delete(['index' => 'k']);
边栏推荐
- tokenizers>=0.11.1,!=0.11.3,<0.13 is required for a normal functioning of this module,
- i++ 和 ++i的真正区别
- 如何在Microsoft Exchange 2010中安装SSL证书
- String implementation strstr()
- 成长:如何深度思考与学习
- ScheduleMaster分布式任务调度中心基本使用和原理
- 申请多域名SSL证书的要求及注意事项
- View. post VS Handler. Differences and usage scenarios of post
- Minio基本使用与原理
- Bitmap is converted into drawable and displayed on the screen
猜你喜欢

ScheduleMaster分布式任务调度中心基本使用和原理

OpenCV学习(一)---环境搭建

如何在Microsoft Exchange 2010中安装SSL证书

How to make small programs on wechat? How to make small programs on wechat

什么是 CRA

Basic use and cluster construction of consult

Flask博客实战 - 实现侧边栏文章归档及标签

On binary tree

Flask博客实战 - 实现侧边栏最新文章及搜索

Redis (II) distributed locks and redis cluster construction
随机推荐
Floating window --- create a system floating window (can be dragged)
Basic use and cluster construction of consult
How do wechat applets make their own programs? How to make small programs on wechat?
How do wechat sell small commodity programs do? How to open wechat apps to sell things?
Byte interview: under what scenario will syn packets be discarded?
国信证券证券账户开户安全吗
Kotlin advanced - class
Android database security: after the user exits, the transaction rollback log still stores relevant data information
Flask博客实战 - 实现个人中心及权限管理
新学派:不诈骗经济学
Can two Mitsubishi PLC adopt bcnettcp protocol to realize wireless communication of network interface?
How to do the wechat selling applet? How to apply for applets
性能之文件系统篇
Computational Thinking and economic thinking
Jetpack compose layout (IV) - constraintlayout
DDS learning notes of opendds
Your driver settings have been set to force 4x antialiasing in OpenGL applications
Handler asynchronous message processing
Experience in writing C
链表 删除链表中的节点
