- VisualStudio2022插件的安装及使用-编程手把手系列文章
- pprof-在现网场景怎么用
- C#实现的下拉多选框,下拉多选树,多级节点
- 【学习笔记】基础数据结构:猫树
ElasticSearch-> mysql 。
index (索引)-> 数据库 。
Documents(文档) -> row(行) 。
Fileds(字段)-> column 。
正排索引 id 内容,类似表格 。
倒排索引 :keywords : ids 。
ip/索引名 。
请求路径:PUT http://127.0.0.1:9200/shopping
请求体:none
成功
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "shopping"
}
ip/_cat/indices?v= 。
请求路径:GET http://127.0.0.1:9200/_cat/indices?v=
请求体:none
成功:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .geoip_databases 5vZtZiLXTw-ZnE-gxFK4RA 1 0 33 35 34.1mb 34.1mb
yellow open user1 XvuPXH4GR3qu9kYgI1vMTg 1 1 0 0 226b 226b
yellow open product OuJtZ2GNQjaANql9jHIhdw 1 1 0 0 226b 226b
yellow open user 84VHenNTTtaJyKUQasAZXA 1 1 3 0 4.8kb 4.8kb
yellow open shopping vqraISHNSFioVa4h58y_4w 1 1 10 6 28kb 28kb
ip/索引名/_doc 。
请求路径: POST http://127.0.0.1:9200/shopping/_doc
请求体:
{
"name": "小米",
"price": 1999,
"url": "htp12344"
}
成功:
{
"_index": "shopping",
"_type": "_doc",
"_id": "0i0_WI8Bs7gKHbbSH-sS",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 20,
"_primary_term": 7
}
指定id创建文档:
ip/索引名/_doc/id 。
请求路径:POST http://127.0.0.1:9200/shopping/_doc/1006
请求体:
{
"name": "魅族21",
"price": 2999,
"url": "htp12344"
}
成功:
{
"_index": "shopping",
"_type": "_doc",
"_id": "1006",
"_version": 3,
"result": "updated",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 21,
"_primary_term": 7
}
ip/索引/_doc/id 。
请求路径: GET http://127.0.0.1:9200/shopping/_doc/1001
请求体:none
成功:
{
"_index": "shopping",
"_type": "_doc",
"_id": "1001",
"_version": 6,
"_seq_no": 7,
"_primary_term": 1,
"found": true,
"_source": {
"name": "小米",
"price": 3999,
"url": "htp123"
}
}
ip/索引/_search 。
请求路径: GET http://127.0.0.1:9200/shopping/_search
请求体:none
成功:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 3,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": "shopping",
"_type": "_doc",
"_id": "F2NHrY4BJgxAo-jxuDZv",
"_score": 1,
"_source": {
"name": "小米",
"price": 1999,
"url": "htp12344"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1001",
"_score": 1,
"_source": {
"name": "小米",
"price": 3999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1004",
"_score": 1,
"_source": {
"name": "华为",
"price": 9999,
"url": "htp123"
}
}
]
}
}
请求路径: GET http://127.0.0.1:9200/shopping/_search
{
"query": {
"match": { //拆词单个查询
"name": "华"
}
}
}
成功:
{
"took": 6,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 3,
"relation": "eq"
},
"max_score": 1.3340157,
"hits": [
{
"_index": "shopping",
"_type": "_doc",
"_id": "1005",
"_score": 1.3340157,
"_source": {
"name": "华为",
"price": 3999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1004",
"_score": 1.3340157,
"_source": {
"name": "华为",
"price": 9999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1001",
"_score": 1.1120224,
"_source": {
"name": "华为1",
"price": 9999,
"url": "htp123"
}
}
]
}
}
请求路径: GET http://127.0.0.1:9200/shopping/_search
请求体:
{
"query": {
"match_phrase": { //全词匹配查询
"name": "华为1"
}
},
"highlight": { //高亮显示这个字段
"fields": {
"name": {}
}
}
}
成功:
{
"took": 58,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 4.0541162,
"hits": [
{
"_index": "shopping",
"_type": "_doc",
"_id": "1001",
"_score": 4.0541162,
"_source": {
"name": "华为1",
"price": 9999,
"url": "htp123"
},
"highlight": {
"name": [
"<em>华</em><em>为</em><em>1</em>"
]
}
}
]
}
}
请求路径: GET http://127.0.0.1:9200/shopping/_search
请求体:
{
"query": {
"bool": {
"must": [ //should表示或,must表示并
{
"match": {
"name": "小米"
}
},
{
"match": {
"price": 3999
}
}
],
"filter": {
"range": {
"price": {
"lt": 5000
}
}
}
}
}
}
成功:
{
"took": 18,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": 2.4093566,
"hits": [
{
"_index": "shopping",
"_type": "_doc",
"_id": "jFvSmY4BzKCXziUqmd-Q",
"_score": 2.4093566,
"_source": {
"name": "小米",
"price": 3999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "jVvYmY4BzKCXziUqX9-H",
"_score": 2.4093566,
"_source": {
"name": "小米",
"price": 3999,
"url": "htp123"
}
}
]
}
}
请求路径: GET http://127.0.0.1:9200/shopping/_search
请求体:
{
"aggs": {
"price_group": { //随意取名
"terms": { //分组
"field": "price" //分组字段
}
}
}
}
{
"took": 38,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": "shopping",
"_type": "_doc",
"_id": "F2NHrY4BJgxAo-jxuDZv",
"_score": 1,
"_source": {
"name": "小米",
"price": 1999,
"url": "htp12344"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "jFvSmY4BzKCXziUqmd-Q",
"_score": 1,
"_source": {
"name": "小米",
"price": 3999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "jVvYmY4BzKCXziUqX9-H",
"_score": 1,
"_source": {
"name": "小米",
"price": 3999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "0i0_WI8Bs7gKHbbSH-sS",
"_score": 1,
"_source": {
"name": "魅族",
"price": 1999,
"url": "htp12344"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1005",
"_score": 1,
"_source": {
"name": "华为",
"price": 3999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1002",
"_score": 1,
"_source": {
"name": "小米",
"price": 1999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1003",
"_score": 1,
"_source": {
"name": "小米",
"price": 999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1004",
"_score": 1,
"_source": {
"name": "华为",
"price": 9999,
"url": "htp123"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1006",
"_score": 1,
"_source": {
"name": "魅族21",
"price": 2999,
"url": "htp12344"
}
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1001",
"_score": 1,
"_source": {
"name": "华为1",
"price": 9999,
"url": "htp123"
}
}
]
},
"aggregations": {
"price_group": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 1999,
"doc_count": 3
},
{
"key": 3999,
"doc_count": 3
},
{
"key": 9999,
"doc_count": 2
},
{
"key": 999,
"doc_count": 1
},
{
"key": 2999,
"doc_count": 1
}
]
}
}
}
ip/索引/_doc/id 。
请求路径: PUT http://127.0.0.1:9200/shopping/_doc/1001
请求体:
{
"name": "小米",
"price": 9999,
"url": "htp123"
}
成功:
{
"_index": "shopping",
"_type": "_doc",
"_id": "1001",
"_version": 7,
"result": "updated",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 22,
"_primary_term": 7
}
ip/索引/_update/id 。
请求路径:PUT http://127.0.0.1:9200/shopping/_update/1001
请求体:
{
"doc": {
"name": "华为1"
}
}
成功:
{
"_index": "shopping",
"_type": "_doc",
"_id": "1001",
"_version": 8,
"result": "updated",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 23,
"_primary_term": 7
}
删除文档:
请求路径:DELETE http://127.0.0.1:9200/shopping/_doc/1001
请求体:none
最后此篇关于es请求方式调用的文章就讲到这里了,如果你想了解更多关于es请求方式调用的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
在 settings.py LANGUAGE_CODE = 'es-mx'或 LANGUAGE_CODE = 'es-ar'不起作用,但是 LANGUAGE_CODE = 'es'或 LANGUAGE
我想知道OpenGL ES 2.0和OpenGL ES 3.0之间有什么区别。 OpenGL ES 3.0的主要优点是什么? 最佳答案 总体而言,这些变化通过更大的缓冲区、更多的格式、更多的统一等提高
这是我为此端点使用 Postman localhost:9201/response_v2_862875ee3a88a6d09c95bdbda029ce2b/_search 的请求正文 { "_sour
OpenGL ES 2.0 没有 ES 1.0 那样的 GL_POINT_SMOOTH 定义。这意味着我用来绘制圆圈的代码不再有效: glEnable(GL_POINT_SMOOTH); glPoin
我尝试编译这个着色器: varying vec2 TexCoords; varying vec4 color; uniform sampler2D text; uniform vec3 textCol
我是 OpenGL ES 的新手,我使用的是 OpenGL ES 2.0 版本。我可以在片段着色器中使用按位操作(右移、左移)吗? 最佳答案 OpenGL ES 2.0 没有按位运算符。 ES 3.0
有没有办法只用线画一个三角形? 我认为GL_TRIANGLES选项可使三角形充满颜色。 最佳答案 使用glPolygonMode(face, model)设置填充模式: glPolygonMode(G
我想用一个包含 yuv 数据的采样器在 opengl es 着色器中将 yuv 转换为 rgb。我的代码如下: 1)我将 yuv 数据发送到纹理: GLES20.glTexImage2D(GLES20
我正在使用这样的域: http://www.domain.com/es/blabla.html 我想更改 .es 的/es 部分并将 URLS 转换为类似以下内容: http://www.domain
有谁知道OpenGL ES是否支持GL_TEXTURE_RECTANGLE?我计划将它用于 2D 图形以支持非二次幂图像。我当前的实现使用 alpha=0 填充的 POT 纹理,对于拉伸(stretc
我需要在具有 PowerVR SGX 硬件的 ARM 设备上实现离屏纹理渲染。 一切都完成了(使用了像素缓冲区和 OpenGL ES 2.0 API)。唯一 Unresolved 问题是速度很慢glR
这是一个奇怪的事情。我有一个片段着色器,据我所知只能返回黑色或红色,但它将像素渲染为白色。如果我删除一根特定的线,它会返回我期望的颜色。它适用于 WebGL,但不适用于 Raspberry Pi 上的
我正在考虑将一些 OpenGL 代码移植到 OpenGL ES 并且想知道这段代码到底做了什么: glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT) 因为 g
我正在考虑将一些 OpenGL 代码移植到 OpenGL ES 并且想知道这段代码到底做了什么: glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT) 因为 g
GLSL ES最多可以编译多少个程序?所以假设我创建了 100 个片段着色器,每个都有不同的效果。所以在运行时我编译所有这些并动态地我用 glUseProgram 交换它们。我假设每次我编译一个新的
我正在尝试使用顶点缓冲区对象来绘制圆,并在 iPhone 上的 OpenGL ES 2.0 中启用 GL_POINT_SMOOTH 来绘制点。 我使用以下 ES 1.0 渲染代码在 iPhone 4
为什么在 OpenGL ES 1.x 中缩放(均匀)对象会导致对象变轻? 更有意义的是它会更暗,因为法线被缩小是否也会使对象更暗?但由于某种原因,物体变轻了。当我放大时,对象变得更暗。在我看来,这应该
我正在尝试通过移植 some code 在 iOS 上的 OpenGL ES 2.0 中获得一些阴影效果。来自标准 GL。部分示例涉及将深度缓冲区复制到纹理: glBindTexture(GL_TEX
所以我正在使用 2D 骨骼动画系统。 有 X 个骨骼,每个骨骼至少有 1 个部分(一个四边形,两个三角形)。平均而言,我可能有 20 块骨头和 30 个部分。大多数骨骼都依赖于父骨骼,骨骼会每帧移动。
我在使用 ES 着色器时遇到了一些晦涩难懂的问题,而且我现在几乎没有想法了。 这是一些代码: .. precision mediump float; .. #define STEP (1f/6f) 5
我是一名优秀的程序员,十分优秀!