当前位置:网站首页>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']);
边栏推荐
- I have summarized the knowledge points of JS [intermediate and advanced] for you
- WPF binding expression and binding data source (I)
- Flask blog practice - realize the latest articles and search in the sidebar
- Yolov5 changing the upper sampling mode
- Basic usage and principle of schedulemaster distributed task scheduling center
- tokenizers>=0.11.1,!= 0.11.3,<0.13 is required for a normal functioning of this module,
- Redis(一)原理与基本使用
- [paper reading | deep reading] line: large scale information network embedding
- This is enough for request & response
- Bitmap is converted into drawable and displayed on the screen
猜你喜欢

Jetpack compose layout (II) - material components and layout

How to make a self-service order wechat applet? How to do the wechat order applet? visual editing

Redis(一)原理与基本使用
![[dynamic planning] - Digital triangle](/img/79/79259ed8931a7968fb55f98a34d9e1.png)
[dynamic planning] - Digital triangle

【论文阅读|深读】DRNE:Deep Recursive Network Embedding with Regular Equivalence

The title of my composition is - "my district head father"

How to apply for a widget on wechat how to get a widget on wechat

我希望按照我的思路尽可能将canvas基础讲明白

Kotlin arrays and collections (1) {create arrays, use arrays, use for in loops to traverse arrays, use array indexes, and multi-dimensional arrays}

How do wechat sell small commodity programs do? How to open wechat apps to sell things?
随机推荐
DDS learning notes of opendds
Unreal Engine graphics and text notes: use VAT (vertex animation texture) to make Houdini end on Houdini special effect (ue4/ue5)
我希望按照我的思路盡可能將canvas基礎講明白
Jetpack compose layout (IV) - constraintlayout
P2P network core technology: Gossip protocol
The gradle configuration supports the upgrade of 64 bit architecture of Xiaomi, oppo, vivo and other app stores
String longest common prefix
OpenCV学习(一)---环境搭建
Request&Response有这一篇就够了
Yolov5更换上采样方式
View. post VS Handler. Differences and usage scenarios of post
Redis (I) principle and basic use
How to make small programs on wechat? How to make small programs on wechat
国信证券证券账户开户安全吗
The path of Architects
Android database security: after the user exits, the transaction rollback log still stores relevant data information
Minio基本使用与原理
性能之网络篇
Deep understanding of JVM - JVM memory model
I hope to explain the basics of canvas as clearly as possible according to my ideas
