当前位置:网站首页>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']);
边栏推荐
- IdentityServer4 定义概念
- String implementation strstr()
- DigiCert和GlobalSign单域名OV SSL证书对比评测
- NetCore性能排查
- [paper reading | depth] role based network embedding via structural features reconstruction with degree regulated
- Jetpack compose layout (II) - material components and layout
- 学会自学【学会学习本身,比学什么都重要】
- Shardingsphere proxy 4.1 sub database and sub table
- Exception: gradle task assemblydebug failed with exit code 1
- 浅谈二叉树
猜你喜欢
Jetpack compose layout (IV) - constraintlayout
Floating window --- create an activity floating window (can be dragged)
ShardingSphere-Proxy 4.1 分庫分錶
Redis (II) distributed locks and redis cluster construction
I hope to explain the basics of canvas as clearly as possible according to my ideas
P2P network core technology: Gossip protocol
How much does a wechat applet cost? Wechat applet development and production costs? Come and have a look
【历史上的今天】6 月 24 日:网易成立;首届消费电子展召开;世界上第一次网络直播
Mongodb's principle, basic use, clustering and partitioned clustering
[paper reading | depth] role based network embedding via structural features reconstruction with degree regulated
随机推荐
【RPC】I/O模型——BIO、NIO、AIO及NIO的Rector模式
Flask blog practice - archiving and labeling of sidebar articles
Kotlin Foundation
WPF binding expression and binding data source (I)
Computational Thinking and economic thinking
DDS learning notes of opendds
Repo sync will automatically switch the correspondence between the local branch and the remote branch - how to customize this behavior
This is enough for request & response
Identityserver4 definition concept
Shardingsphere proxy 4.1 Sous - base de données sous - table
性能之网络篇
I have summarized the knowledge points of JS [intermediate and advanced] for you
Basic use and cluster construction of consult
Bug- solve the display length limitation of log distinguished character encoding (edittext+lengthfilter)
【历史上的今天】6 月 24 日:网易成立;首届消费电子展召开;世界上第一次网络直播
Houdini图文笔记:Your driver settings have been set to force 4x Antialiasing in OpenGL applications问题的解决
What is CRA
Tutorial on installing SSL certificates in Microsoft Exchange Server 2007
Use of Siemens plcs7-200 (I) -- Introduction to development environment and configuration software
持续交付-Jenkinsfile 语法