Elasticsearch学习笔记(3)

news2024/10/1 10:33:40

RestAPI

Elasticsearch(ES)官方提供了多种语言的客户端库,用于与Elasticsearch进行交互。这些客户端库的主要功能是帮助开发者更方便地构建和发送DSL(Domain Specific Language)查询语句,并通过HTTP请求与Elasticsearch集群进行通信。

官方文档地址:

https://www.elastic.co/guide/en/elasticsearch/client/index.html

初始化RestClient 

Maven 配置

以下是使用 maven 作为依赖项管理器配置依赖项的方法。将以下内容添加到pom.xml文件中:

<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>elasticsearch-rest-high-level-client</artifactId>
    <version>7.12.1</version>
</dependency>

application.properties

# 定义应用程序的名称,用于服务发现、健康检查等
spring.application.name=demo

# 配置Elasticsearch服务器的地址
spring.elasticsearch.uris=http://localhost:9201
# 配置Elasticsearch的用户名,用于身份验证
spring.elasticsearch.username=elastic
# 配置Elasticsearch的密码,用于身份验证
spring.elasticsearch.password=changeme

Elasticsearch配置类

package com.example.demo.Config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Elasticsearch配置类,用于配置和创建Elasticsearch客户端
 */
@Configuration
public class ElasticsearchConfig {

    /**
     * 创建并配置RestHighLevelClient客户端实例
     * 该方法将在Spring容器中注册一个RestHighLevelClient类型的Bean,供应用程序使用
     *
     * @return 返回配置好的RestHighLevelClient实例
     */
    @Bean
    public RestHighLevelClient client() {
        // 使用RestClient.builder方法构建一个HttpHost对象,指定Elasticsearch服务器的地址和端口
        // 这里连接的是本地的Elasticsearch服务器,端口为9201,使用HTTP协议
        return new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9201, "http"))
        );
    }
}

为了单元测试方便,我们创建一个测试类

package com.example.demo;

import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.core.MainResponse;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.IOException;

import static org.junit.jupiter.api.Assertions.assertNotNull;

@SpringBootTest
public class ElasticsearchConnectionTest {

    @Autowired
    private RestHighLevelClient client;

    @Test
    public void testElasticsearchConnection() throws IOException {
        MainResponse response = client.info(RequestOptions.DEFAULT);
        assertNotNull(response);
        System.out.println("Elasticsearch集群名称: " + response.getClusterName());
        System.out.println("Elasticsearch节点名称: " + response.getNodeName());
    }
}

创建、删除索引库

先创建ElasticsearchIndexService类

package com.example.demo.Service;

import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.client.indices.CreateIndexResponse;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;

/**
 * Elasticsearch索引服务类
 * 提供创建和删除索引的功能
 */
@Service
public class ElasticsearchIndexService {

    @Autowired
    private RestHighLevelClient client;

    /**
     * 创建索引
     * 如果索引不存在,则创建一个新的索引
     *
     * @param indexName 索引名称
     */
    public void createIndex(String indexName) {
        try {
            // 检查索引是否存在
            if (!indexExists(indexName)) {
                // 创建索引请求
                CreateIndexRequest request = new CreateIndexRequest(indexName);
                // 发送创建索引请求
                CreateIndexResponse createIndexResponse = client.indices().create(request, RequestOptions.DEFAULT);
                // 判断索引是否成功创建
                if (createIndexResponse.isAcknowledged()) {
                    System.out.println("索引库创建成功: " + indexName);
                } else {
                    System.out.println("索引库创建失败: " + indexName);
                }
            } else {
                // 如果索引已存在,打印提示信息
                System.out.println("索引库已存在: " + indexName);
            }
        } catch (IOException e) {
            // 捕获并打印异常信息
            e.printStackTrace();
        }
    }
    /**
     * 删除索引
     * 如果索引存在,则删除该索引
     *
     * @param indexName 索引名称
     */
    public void deleteIndex(String indexName) {
        try {
            // 检查索引是否存在
            if (indexExists(indexName)) {
                // 创建删除索引请求
                DeleteIndexRequest request = new DeleteIndexRequest(indexName);
                // 发送删除索引请求
                AcknowledgedResponse deleteIndexResponse = client.indices().delete(request, RequestOptions.DEFAULT);
                // 判断索引是否成功删除
                if (deleteIndexResponse.isAcknowledged()) {
                    System.out.println("索引库删除成功: " + indexName);
                } else {
                    System.out.println("索引库删除失败: " + indexName);
                }
            } else {
                // 如果索引不存在,打印提示信息
                System.out.println("索引库不存在: " + indexName);
            }
        } catch (IOException e) {
            // 捕获并打印异常信息
            e.printStackTrace();
        }
    }
    /**
     * 检查索引是否存在
     *
     * @param indexName 索引名称
     * @return true如果索引存在,否则返回false
     */
    public boolean indexExists(String indexName) {
        // 创建一个获取索引请求对象,并传入索引名称
        GetIndexRequest request = new GetIndexRequest(indexName);
        try {
            // 调用Elasticsearch客户端的indices().exists()方法,传入请求对象和请求选项,返回索引是否存在的布尔值
            return client.indices().exists(request, RequestOptions.DEFAULT);
        } catch (IOException e) {
            // 捕获并打印异常信息
            e.printStackTrace();
            // 如果发生异常,则认为索引不存在,返回false
            return false;
        }
    }

}

在Spring Boot应用程序中,可以通过调用这些服务方法来操作Elasticsearch索引库。

package com.example.demo.Component;

import com.example.demo.Service.ElasticsearchIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class ElasticsearchRunner implements CommandLineRunner {

    @Autowired
    private ElasticsearchIndexService elasticsearchIndexService;

    @Override
    public void run(String... args) throws Exception {
        String indexName = "my_index";

        // 创建索引
        elasticsearchIndexService.createIndex(indexName);

        // 判断索引是否存在
        boolean exists = elasticsearchIndexService.indexExists(indexName);
        System.out.println("索引库是否存在: " + exists);

        // 删除索引
        elasticsearchIndexService.deleteIndex(indexName);
    }
}

RestClient操作文档

单一文档 API

1. 索引 API (Index API)

用于将单一文档添加或更新到索引中。

  • HTTP 方法:PUT 或 POST
  • 请求 URL:PUT /<index>/_doc/<id> 或 POST /<index>/_doc/
  • 功能:如果提供了 ID,则更新文档;如果没有 ID,则创建一个新文档。

示例:

PUT /my-index/_doc/1
{
  "user": "kimchy",
  "message": "trying out Elasticsearch"
}
@Service  // 注解表明该类是一个 Spring 服务类,用于业务逻辑处理
public class ElasticsearchService {

    @Autowired  // 自动装配 RestHighLevelClient 实例
    private RestHighLevelClient client;

    // 索引文档方法
    public String indexDocument(String index, String id, Map<String, Object> document) throws IOException {
        // 创建 IndexRequest,指定索引名称和文档 ID,并设置要存储的文档内容
        IndexRequest request = new IndexRequest(index)
                .id(id)  // 设置文档 ID
                .source(document);  // 设置文档源数据(一个 Map 对象)
        
        // 使用 client 对象调用 index 方法,将请求发送到 Elasticsearch
        IndexResponse response = client.index(request, RequestOptions.DEFAULT);
        
        // 返回创建后的文档 ID
        return response.getId();
    }
}

 2. 获取 API (Get API)

用于通过文档 ID 获取文档。

  • HTTP 方法:GET
  • 请求 URL:GET /<index>/_doc/<id>
  • 功能:返回包含文档的 JSON 数据。

示例:

GET /my-index/_doc/1
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入客户端
    private RestHighLevelClient client;

    // 获取文档方法
    public Map<String, Object> getDocument(String index, String id) throws IOException {
        // 创建 GetRequest 请求,指定索引和文档 ID
        GetRequest request = new GetRequest(index, id);
        
        // 执行请求,返回 GetResponse 对象
        GetResponse response = client.get(request, RequestOptions.DEFAULT);
        
        // 返回文档内容 (source),即存储在文档中的数据
        return response.getSource();
    }
}

 3. 获取源 API (Get Source API)

仅返回文档的 _source 字段,而不包含元数据。

  • HTTP 方法:GET
  • 请求 URL:GET /<index>/_source/<id>
  • 功能:返回文档的 _source 部分,省略其他信息。

示例:

GET /my-index/_source/1
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动装配客户端
    private RestHighLevelClient client;

    // 获取文档源数据
    public Map<String, Object> getDocumentSource(String index, String id) throws IOException {
        // 创建 GetSourceRequest,指定索引和文档 ID
        GetSourceRequest request = new GetSourceRequest(index, id);
        
        // 执行请求,返回源数据 (即文档内容)
        return client.getSource(request, RequestOptions.DEFAULT);
    }
}

 4. 存在 API (Exists API)

检查文档是否存在。

  • HTTP 方法:HEAD
  • 请求 URL:HEAD /<index>/_doc/<id>
  • 功能:如果文档存在返回 200 状态码,否则返回 404。

示例:

HEAD /my-index/_doc/1
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入客户端
    private RestHighLevelClient client;

    // 检查文档是否存在
    public boolean documentExists(String index, String id) throws IOException {
        // 创建 GetRequest 请求,但不获取文档源数据
        GetRequest request = new GetRequest(index, id);
        request.fetchSourceContext(new FetchSourceContext(false));  // 禁止返回文档源
        request.storedFields("_none_");  // 不返回任何存储字段
        
        // 调用 exists 方法检查文档是否存在
        return client.exists(request, RequestOptions.DEFAULT);
    }
}

 5. 删除 API (Delete API)

用于删除指定 ID 的文档。

  • HTTP 方法:DELETE
  • 请求 URL:DELETE /<index>/_doc/<id>
  • 功能:删除指定文档,如果不存在则返回 404。

示例:

DELETE /my-index/_doc/1
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动装配客户端
    private RestHighLevelClient client;

    // 删除文档方法
    public String deleteDocument(String index, String id) throws IOException {
        // 创建 DeleteRequest 请求,指定索引和文档 ID
        DeleteRequest request = new DeleteRequest(index, id);
        
        // 执行请求,返回 DeleteResponse 响应
        DeleteResponse response = client.delete(request, RequestOptions.DEFAULT);
        
        // 返回删除结果(比如 "DELETED")
        return response.getResult().name();
    }
}

 6. 更新 API (Update API)

部分更新文档,允许你只更新部分字段而不是替换整个文档。

  • HTTP 方法:POST
  • 请求 URL:POST /<index>/_update/<id>
  • 功能:可以通过脚本或部分字段更新文档。

示例:

POST /my-index/_update/1
{
  "doc": {
    "message": "updated message"
  }
}
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动装配客户端
    private RestHighLevelClient client;

    // 更新文档
    public String updateDocument(String index, String id, Map<String, Object> updates) throws IOException {
        // 创建 UpdateRequest 请求,指定索引和文档 ID,并设置更新的内容
        UpdateRequest request = new UpdateRequest(index, id)
                .doc(updates);  // 使用 doc 方法更新指定字段
        
        // 执行更新请求,返回 UpdateResponse 响应
        UpdateResponse response = client.update(request, RequestOptions.DEFAULT);
        
        // 返回更新结果
        return response.getResult().name();
    }
}

7. 词向量 API (Term Vectors API)

用于返回文档的词项向量,包括词项频率、词频逆文档频率等。

  • HTTP 方法:GET
  • 请求 URL:GET /<index>/_termvectors/<id>
  • 功能:分析文档并返回词项的详细统计数据。

示例:

GET /my-index/_termvectors/1
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入客户端
    private RestHighLevelClient client;

    // 获取词项向量
    public TermVectorsResponse getTermVectors(String index, String id) throws IOException {
        // 创建 TermVectorsRequest 请求,指定索引和文档 ID
        TermVectorsRequest request = new TermVectorsRequest(index, id);
        
        // 执行请求,返回 TermVectorsResponse 响应
        return client.termvectors(request, RequestOptions.DEFAULT);
    }
}

多文档 API

1. 批量 API (Bulk API)

允许你在一次请求中执行多次操作(如创建、更新、删除)。

  • HTTP 方法:POST
  • 请求 URL:POST /_bulk
  • 功能:在一个请求中进行批量的索引、删除、更新操作。

示例:

POST /_bulk
{ "index" : { "_index" : "my-index", "_id" : "1" } }
{ "user" : "kimchy", "message" : "trying out Elasticsearch" }
{ "delete" : { "_index" : "my-index", "_id" : "2" } }
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入客户端
    private RestHighLevelClient client;

    // 批量操作
    public BulkResponse bulkOperation(List<BulkOperation> operations) throws IOException {
        // 创建 BulkRequest 对象用于批量操作
        BulkRequest request = new BulkRequest();
        
        // 循环处理每个操作,将其加入 BulkRequest 请求
        operations.forEach(op -> {
            if (op.getAction().equals("index")) {
                request.add(new IndexRequest(op.getIndex())
                        .id(op.getId())  // 为索引操作设置 ID
                        .source(op.getDocument()));  // 设置文档内容
            } else if (op.getAction().equals("delete")) {
                request.add(new DeleteRequest(op.getIndex(), op.getId()));  // 删除文档操作
            }
        });
        
        // 执行批量请求,返回响应
        return client.bulk(request, RequestOptions.DEFAULT);
    }
}

 2. 多重获取 API (Multi Get API)

允许在一个请求中获取多个文档。

  • HTTP 方法:POST
  • 请求 URL:POST /_mget
  • 功能:在一个请求中获取多个文档,可以来自不同的索引。

示例:

POST /_mget
{
  "docs" : [
    { "_index" : "my-index", "_id" : "1" },
    { "_index" : "my-index", "_id" : "2" }
  ]
}
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入客户端
    private RestHighLevelClient client;

    // 多重获取文档
    public List<Map<String, Object>> multiGetDocuments(String index, List<String> ids) throws IOException {
        // 创建 MultiGetRequest 对象
        MultiGetRequest request = new MultiGetRequest();
        
        // 将每个文档 ID 添加到请求中
        ids.forEach(id -> request.add(new MultiGetRequest.Item(index, id)));
        
        // 执行请求,返回 MultiGetResponse 响应
        MultiGetResponse response = client.mget(request, RequestOptions.DEFAULT);

        // 处理每个文档的响应,返回其源数据
        List<Map<String, Object>> results = new ArrayList<>();
        for (MultiGetItemResponse item : response.getResponses()) {
            results.add(item.getResponse().getSource());
        }
        return results;
    }
}

 3. 重新索引 API (Reindex API)

用于从一个索引复制文档到另一个索引。

  • HTTP 方法:POST
  • 请求 URL:POST /_reindex
  • 功能:将数据从一个索引迁移到另一个索引。

示例:

POST /_reindex
{
  "source": {
    "index": "old-index"
  },
  "dest": {
    "index": "new-index"
  }
}
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入客户端
    private RestHighLevelClient client;

    // 重新索引方法
    public BulkByScrollResponse reindex(String sourceIndex, String destIndex) throws IOException {
        // 创建 ReindexRequest 对象,指定源索引和目标索引
        ReindexRequest request = new ReindexRequest();
        request.setSourceIndices(sourceIndex);
        request.setDestIndex(destIndex);
        
        // 执行重新索引操作,返回响应
        return client.reindex(request, RequestOptions.DEFAULT);
    }
}

 4. 通过查询 API 进行更新 (Update By Query API)

根据查询条件更新多个文档。

  • HTTP 方法:POST
  • 请求 URL:POST /<index>/_update_by_query
  • 功能:批量更新符合条件的文档。

示例:

POST /my-index/_update_by_query
{
  "script": {
    "source": "ctx._source.field += 1"
  },
  "query": {
    "term": {
      "field": "value"
    }
  }
}
@Service  // 声明服务类,用于包含业务逻辑
public class ElasticsearchService {

    @Autowired  // 自动注入 RestHighLevelClient 实例
    private RestHighLevelClient client;

    // 通过查询更新文档的方法
    public BulkByScrollResponse updateByQuery(String index, String field, String oldValue, String newValue) throws IOException {
        // 创建 UpdateByQueryRequest 对象,指定索引
        UpdateByQueryRequest request = new UpdateByQueryRequest(index);
        
        // 设置查询条件,使用 QueryBuilders 来查找匹配指定字段和值的文档
        request.setQuery(QueryBuilders.matchQuery(field, oldValue));
        
        // 使用 Script 进行更新,编写脚本来修改查询结果中的字段值
        request.setScript(new Script(
                ScriptType.INLINE,  // 脚本类型为内联脚本
                "painless",  // 脚本语言为 Painless
                "ctx._source['" + field + "'] = '" + newValue + "'",  // 脚本内容:更新指定字段的值
                Collections.emptyMap()));  // 无额外的参数传递
        
        // 执行更新操作并返回响应
        return client.updateByQuery(request, RequestOptions.DEFAULT);
    }
}

 5. 按查询删除 API (Delete By Query API)

根据查询条件删除文档。

  • HTTP 方法:POST
  • 请求 URL:POST /<index>/_delete_by_query
  • 功能:批量删除符合查询条件的文档。

示例:

POST /my-index/_delete_by_query
{
  "query": {
    "term": {
      "user": "kimchy"
    }
  }
}
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入 RestHighLevelClient 实例
    private RestHighLevelClient client;

    // 按查询删除文档的方法
    public BulkByScrollResponse deleteByQuery(String index, String field, String value) throws IOException {
        // 创建 DeleteByQueryRequest 对象,指定索引
        DeleteByQueryRequest request = new DeleteByQueryRequest(index);
        
        // 设置查询条件,查找要删除的文档
        request.setQuery(QueryBuilders.matchQuery(field, value));
        
        // 执行删除操作,返回 BulkByScrollResponse 响应
        return client.deleteByQuery(request, RequestOptions.DEFAULT);
    }
}

 6. 重新节流 API (Rethrottle API)

动态调整某些任务的处理速率,例如 reindex、update_by_query 等。

  • HTTP 方法:POST
  • 请求 URL:POST /_tasks/<task_id>/_rethrottle
  • 功能:调整指定任务的吞吐量。

示例:

POST /_tasks/TASK_ID/_rethrottle?requests_per_second=1000
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入 RestHighLevelClient 实例
    private RestHighLevelClient client;

    // 重新节流方法,用于动态调整操作的节流速率
    public TaskSubmissionResponse rethrottleTask(String taskId, float requestsPerSecond) throws IOException {
        // 调用 Rethrottle API 来修改指定任务的节流速率
        // 通过 ReindexRethrottleRequest 对象进行节流
        ReindexRethrottleRequest request = new ReindexRethrottleRequest(taskId, requestsPerSecond);
        
        // 执行请求,并返回响应
        return client.reindexRethrottle(request, RequestOptions.DEFAULT);
    }
}

 7. 多项向量 API (Multi Term Vectors API)

允许在一个请求中为多个文档返回词项向量。

  • HTTP 方法:POST
  • 请求 URL:POST /<index>/_mtermvectors
  • 功能:获取多个文档的词向量信息。

示例:

POST /my-index/_mtermvectors
{
  "docs": [
    { "_id": "1" },
    { "_id": "2" }
  ]
}
@Service  // 声明服务类
public class ElasticsearchService {

    @Autowired  // 自动注入 RestHighLevelClient 实例
    private RestHighLevelClient client;

    // 获取多个文档的词向量方法
    public List<TermVectorsResponse> multiTermVectors(String index, List<String> ids) throws IOException {
        // 创建 MultiTermVectorsRequest 对象
        MultiTermVectorsRequest request = new MultiTermVectorsRequest();
        
        // 循环将每个文档 ID 加入请求中
        ids.forEach(id -> request.add(new TermVectorsRequest(index, id)));
        
        // 执行请求,返回 MultiTermVectorsResponse 响应
        MultiTermVectorsResponse response = client.mtermvectors(request, RequestOptions.DEFAULT);
        
        // 将每个 TermVectorsResponse 提取出来
        List<TermVectorsResponse> termVectorsResponses = new ArrayList<>();
        response.forEach(termVectorsResponses::add);
        
        // 返回所有文档的词向量
        return termVectorsResponses;
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2182128.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

全面提升MySQL性能:从硬件到配置再到代码的最佳实践

MySQL 是全球最流行的开源关系型数据库管理系统之一&#xff0c;广泛应用于各种规模的应用程序中。随着应用规模的增长&#xff0c;数据库的性能优化成为提升系统整体性能的关键因素。本文将从多个角度探讨如何对MySQL进行性能优化&#xff0c;帮助开发者和DBA解决实际问题&…

JWT 令牌生成报错

一、问题描述 我在获取JWT令牌时&#xff0c;报了一个这样的错误 error&#xff1a;io.jsonwebtoken.security.WeakKeyException: The signing keys size is 64 bits which is not secure enough for the HS256 algorithm. 二、问题原因 原因是我这里指定的签名密钥也就是si…

java实现的无头单向非循环链表

java实现的无头单向非循环链表 ArrayList的缺陷链表链表的概念及结构无头单向非循环链表的实现链表OJ题 ArrayList的缺陷 由于ArrayList底层是一段连续空间&#xff0c;当在ArrayList任意位置插入或者删除元素时&#xff0c;就需要将后序元素整体往前或者往后搬移&#xff0c;…

使用C语言获取iostat中的await值的方法和方案

使用C语言获取iostat中的await值的方法和方案 1. 准备工作2. 调用iostat命令并获取输出3. 解析iostat输出4. 完整实现和错误处理5. 注意事项在Linux系统中,iostat命令是sysstat软件包的一部分,用于监控系统的CPU、网卡、tty设备、磁盘、CD-ROM等设备的活动情况和负载信息。其…

逻辑回归(下): Sigmoid 函数的发展历史

背景 闲来无事翻了一下之前买的一个机器学习课程及之前记录的网络笔记&#xff0c;发现遇到公式都是截图&#xff0c;甚至是在纸上用笔推导的。重新整理一遍之前逻辑回归函数的学习笔记&#xff0c;主要是为了玩一下 LaTex 语法&#xff0c;写公式挺有意思的。 整理之前三篇笔…

VMware 虚拟机 下载安装 Centos7 和Windows10 镜像源

准备工作 下载 VMware链接&#xff1a;稍后发布链接 Centos7完整版链接&#xff1a;https://www.123865.com/ps/EF7OTd-mdAnH Centos7mini版链接&#xff1a;https://www.123865.com/ps/EF7OTd-1dAnH Windows10链接&#xff1a;https://www.123865.com/ps/EF7OTd-4dAnH 演示环境…

win11任务栏颜色怎么修改?透明任务栏效果可以实现吗?5套方案!

win11任务栏颜色怎么修改&#xff1f; ■ 通过系统个性化设置、任务栏设置、金舟Translucent任务栏、Glass8、注册表等方式可以快速修改Windows11电脑任务栏颜色。 在重度使用电脑办公的过程中&#xff0c;大家除了对电脑壁纸有一点的设计感外&#xff0c;小编发现不少人对电…

【Qt】Qt安装(2024-10,QT6.7.3,Windows,Qt Creator 、Visual Studio、Pycharm 示例)

文章目录 一、Qt 简介二、安装开源版本2.1 Qt 官网 与 版本选择2.2 Qt 安装程序 三、使用示例3.1 Qt Creator3.11 示例程序3.12 新建C项目3.13 新建Python项目 3.2 Visual Studio 附录附录 1&#xff1a;Additional Libraries 说明附录2 &#xff1a;老版本安装附录3&#xff1…

基于大数据架构的就业岗位推荐系统

作者&#xff1a;计算机学姐 开发技术&#xff1a;SpringBoot、SSM、Vue、MySQL、JSP、ElementUI、Python、小程序等&#xff0c;“文末源码”。 专栏推荐&#xff1a;前后端分离项目源码、SpringBoot项目源码、Vue项目源码、SSM项目源码、微信小程序源码 精品专栏&#xff1a;…

Redis入门第一步:认识Redis与快速安装配置

认识Redis与快速安装配置&#x1f343; Redis是什么&#x1f432; 1.Redis的背景&#x1f38d; Redis&#xff08;Remote Dictionary Server&#xff09;译为"远程字典服务"&#xff0c;它是一款基于内存实现的键值型 NoSQL 数据库&#xff0c; 通常也被称为数据结…

An End-to-End Local Attention Based Model for Table Recognition(ICDAR 2023)

An End-to-End Local Attention Based Model for Table Recognition(ICDAR 2023) 一.前述 作者认为基于Transformer的表格识别模型很难处理大表格的识别&#xff0c;原因是受限于它的全局注意力global attention机制。 基于以上&#xff0c;作者提出了一种局部注意力local a…

【HTML并不简单】笔记1-常用rel总结:nofollow、noopener、opener、noreferrer,relList

文章目录 rel"nofollow"rel"noopener"与rel"opener"rel"noreferrer"relList对象 《HTML并不简单&#xff1a;Web前端开发精进秘籍》张鑫旭&#xff0c;一些摘要&#xff1a; HTML&#xff0c;这门语言的知识体系非常庞杂&#xff0c;涉…

Windows开发工具使用技巧全面指南

目录 目录 Visual Studio 功能概述 使用技巧 快捷键表 Visual Studio Code 功能概述 常用扩展 使用技巧 PowerShell 功能概述 常用命令 脚本编写技巧 Git for Windows 功能概述 集成技巧 常用命令表 调试工具 Visual Studio调试器 使用技巧 WinDbg 使用技…

828华为云征文|部署音乐流媒体服务器 mStream

828华为云征文&#xff5c;部署音乐流媒体服务器 mStream 一、Flexus云服务器X实例介绍二、Flexus云服务器X实例配置2.1 重置密码2.2 服务器连接2.3 安全组配置2.4 Docker 环境搭建 三、Flexus云服务器X实例部署 mStream3.1 mStream 介绍3.2 mStream 部署3.3 mStream 使用 四、…

UE4完整教程 UE4简介 UE4学习攻略及文件格式

开头附上工作招聘面试必备问题噢~~包括综合面试题、无领导小组面试题资源文件免费!全文干货。 UE4简介学习攻略UE4Demo代码面试内容资源-CSDN文库https://download.csdn.net/download/m0_72216164/89825102 工作招聘无领导小组面试全攻略最常见面试题(第一部分)共有17章+可…

PCL 点云模型滤波(圆形)

目录 一、概述 1.1原理 1.2实现步骤 1.3应用场景 二、代码实现 2.1关键函数 2.1.1 生成点云数据 2.1.2 模型滤波函数 2.1.3 可视化函数 2.2完整代码 三、实现效果 PCL点云算法汇总及实战案例汇总的目录地址链接&#xff1a; PCL点云算法与项目实战案例汇总&#xf…

「JavaScript深入」彻底理解JS中的闭包

JavaScript深入 — 闭包 一、概念二、示例三、实用的闭包四、用闭包模拟私有方法五、一个常见错误&#xff1a;在循环中创建闭包&#x1f330; 另一个经典例子-定时器与闭包 六、优劣好处坏处解决 七、图解闭包八、应用 &#x1f4aa;封装私有变量函数工厂异步操作中的回调函数…

css中背景色、背景图的使用

1、同时使用背景色、背景图片 参考链接&#xff1a;链接 以下样式&#xff0c;背景色在图片下方(缺点&#xff1a;图片不透明时&#xff0c;背景色会被完全遮挡。) .header {height: 100%;width: 100%;background-color: #000;background-image: url(/static/images/back.pn…

云原生之运维监控实践-使用Prometheus与Grafana实现对MySQL和Redis服务的监测

背景 如果你要为应用程序构建规范或用户故事&#xff0c;那么务必先把应用程序每个组件的监控指标考虑进来&#xff0c;千万不要等到项目结束或部署之前再做这件事情。——《Prometheus监控实战》 去年写了一篇在Docker环境下部署若依微服务ruoyi-cloud项目的文章&#xff0c;当…

数据结构之手搓顺序表(顺序表的增删查改)

目录 文章目录 前言 一、什么是顺序表&#xff1f; 二、动态顺序表的实现 1.头文件定义 2.实现顺序表的初始化 3.检查顺序表空间容量是否足够&#xff0c;不够就增容 4.顺序表的销毁 5.顺序表的打印 6.顺序表的尾插 7.顺序表的头插 8.顺序表的头删 9.顺序表的尾删 10.顺序…