ElasticSearch中基础API操作

news2025/1/23 13:16:52

1:首先我们需要连接ElasticSearch客户端,需要一个连接操作: RestHighLevelClient

package com.atguigu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

public class ESTest_Client {
    public static void main(String[] args) throws Exception {

        // 创建ES客户端
        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 关闭ES客户端
        esClient.close();
    }
}

2:建立的客户端后,我们需要先进行索引的创建,查询,删除操作:

2.1:创建索引: CreateIndexRequest 响应: esClient.indices().create

package com.atguigu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.client.indices.CreateIndexResponse;

public class ESTest_Index_Create {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 创建索引
        CreateIndexRequest request = new CreateIndexRequest("user");
        CreateIndexResponse createIndexResponse =
                esClient.indices().create(request, RequestOptions.DEFAULT);


        // 响应状态
        boolean acknowledged = createIndexResponse.isAcknowledged();
        System.out.println("索引操作 :" + acknowledged);

        esClient.close();
    }
}

请添加图片描述

2.2:查询索引: GetIndexRequest 响应: esClient.indices().get

package com.atguigu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
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.client.indices.GetIndexResponse;

public class ESTest_Index_Search {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 查询索引
        GetIndexRequest request = new GetIndexRequest("user");

        GetIndexResponse getIndexResponse =
                esClient.indices().get(request, RequestOptions.DEFAULT);

        // 响应状态
        System.out.println(getIndexResponse.getAliases());
        System.out.println(getIndexResponse.getMappings());
        System.out.println(getIndexResponse.getSettings());

        esClient.close();
    }
}

2.3:删除索引: DeleteIndexRequest 响应: esClient.indices().delete

package com.atguigu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.client.indices.GetIndexResponse;

public class ESTest_Index_Delete {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 查询索引
        DeleteIndexRequest request = new DeleteIndexRequest("user");

        AcknowledgedResponse response = esClient.indices().delete(request, RequestOptions.DEFAULT);

        // 响应状态
        System.out.println(response.isAcknowledged());

        esClient.close();
    }
}

3:索引创建好后我们需要将索引里面插入文档数据,包过数据的查询删除等等操作

3.1:将数据插入索引: IndexRequest 响应:esClient.index

3.1.1:首先建立一个实体类存放我们要插入的数据类:User请添加图片描述

#3.1.2:然后向对应的索引中插入数据:这里的步骤分三步:

(1):new出索引,并指向我们要插入数据的索引: request.index("user").id("1001");

请添加图片描述

(2):将数据插入到实体类,并要穿换成json格式:

请添加图片描述

(3):默认响应:IndexResponseesClient.index

   IndexResponse response = esClient.index(request, RequestOptions.DEFAULT);
package com.atguigu.es.test;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpHost;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.client.indices.GetIndexResponse;
import org.elasticsearch.common.xcontent.XContentType;

public class ESTest_Doc_Insert {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 插入数据
        IndexRequest request = new IndexRequest();
        request.index("user").id("1001");

        User user = new User();
        user.setName("zhangsan");
        user.setAge(30);
        user.setSex("男");

        // 向ES插入数据,必须将数据转换位JSON格式
        ObjectMapper mapper = new ObjectMapper();
        String userJson = mapper.writeValueAsString(user);
        request.source(userJson, XContentType.JSON);

        IndexResponse response = esClient.index(request, RequestOptions.DEFAULT);

        System.out.println(response.getResult());

        esClient.close();
    }
}

3.2:修改索引中数据:UpdateRequest 响应: esClient.update

修改索引中的数据:跟上面类似,还是要先定位到哪个索引然后进行修改:

package com.atguigu.es.test;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpHost;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentType;

public class ESTest_Doc_Update {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 修改数据
        UpdateRequest request = new UpdateRequest();
        request.index("user").id("1001");
        request.doc(XContentType.JSON, "sex", "女");

        UpdateResponse response = esClient.update(request, RequestOptions.DEFAULT);

        System.out.println(response.getResult());

        esClient.close();
    }
}

3.3:查询索引中的数据: GetRequest 响应: esClient.get

package com.atguigu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentType;

public class ESTest_Doc_Get {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 查询数据
        GetRequest request = new GetRequest();
        request.index("user").id("1001");
        GetResponse response = esClient.get(request, RequestOptions.DEFAULT);

        System.out.println(response.getSourceAsString());

        esClient.close();
    }
}

3.4:删除索引中的文档(数据): DeleteRequest 响应:esClient.delete

package com.atguigu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

public class ESTest_Doc_Delete {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );


        DeleteRequest request = new DeleteRequest();
        request.index("user").id("1001");

        DeleteResponse response = esClient.delete(request, RequestOptions.DEFAULT);
        System.out.println(response.toString());

        esClient.close();
    }
}

3.5:批量插入数据: BulkRequest 响应: esClient.bulk

相当于就是在一个BulkRequest里面包含很多IndexRequest().index

package com.atguigu.es.test;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpHost;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentType;

public class ESTest_Doc_Insert_Batch {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 批量插入数据
        BulkRequest request = new BulkRequest();

//        request.add(new IndexRequest().index("user").id("1001").source(XContentType.JSON, "name", "zhangsan", "age",30,"sex","男"));
//        request.add(new IndexRequest().index("user").id("1002").source(XContentType.JSON, "name", "lisi", "age",30,"sex","女"));
//        request.add(new IndexRequest().index("user").id("1003").source(XContentType.JSON, "name", "wangwu", "age",40,"sex","男"));
//        request.add(new IndexRequest().index("user").id("1004").source(XContentType.JSON, "name", "wangwu1", "age",40,"sex","女"));
//        request.add(new IndexRequest().index("user").id("1005").source(XContentType.JSON, "name", "wangwu2", "age",50,"sex","男"));
//        request.add(new IndexRequest().index("user").id("1006").source(XContentType.JSON, "name", "wangwu3", "age",50,"sex","男"));
        //request.add(new IndexRequest().index("user").id("1007").source(XContentType.JSON, "name", "wangwu44", "age",60,"sex","男"));
        //request.add(new IndexRequest().index("user").id("1008").source(XContentType.JSON, "name", "wangwu555", "age",60,"sex","男"));
        request.add(new IndexRequest().index("user").id("1009").source(XContentType.JSON, "name", "wangwu66666", "age",60,"sex","男"));

        BulkResponse response = esClient.bulk(request, RequestOptions.DEFAULT);
        System.out.println(response.getTook());
        System.out.println(response.getItems());

        esClient.close();
    }
}

3.6:批量删除: BulkRequest 响应:esClient.bulk,相当于一个 BulkRequest里面包含很多DeleteRequest().index

package com.atguigu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentType;

public class ESTest_Doc_Delete_Batch {
    public static void main(String[] args) throws Exception {

        RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 批量删除数据
        BulkRequest request = new BulkRequest();

        request.add(new DeleteRequest().index("user").id("1001"));
        request.add(new DeleteRequest().index("user").id("1002"));
        request.add(new DeleteRequest().index("user").id("1003"));

        BulkResponse response = esClient.bulk(request, RequestOptions.DEFAULT);
        System.out.println(response.getTook());
        System.out.println(response.getItems());

        esClient.close();
    }
}

3.7:全量查询:SearchRequest 响应:esClient.search

注意变化: request.indices("user");

请添加图片描述

   RestHighLevelClient esClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http"))
        );

        // 1. 查询索引中全部的数据
        SearchRequest request = new SearchRequest();
        request.indices("user");

        request.source(new SearchSourceBuilder().query(QueryBuilders.matchAllQuery()));

        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.8:条件查询:与全量查询变化:QueryBuilders.termQuery("age", 30)

        // 2. 条件查询 : termQuery
        SearchRequest request = new SearchRequest();
        request.indices("user");

        request.source(new SearchSourceBuilder().query(QueryBuilders.termQuery("age", 30)));
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.9:分页查询 builder.from(2); builder.size(2);

    3. 分页查询
        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder().query(QueryBuilders.matchAllQuery());
        // (当前页码-1)*每页显示数据条数
        builder.from(2);
        builder.size(2);
        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.10:查询排序: builder.sort("age", SortOrder.DESC);

        // 4. 查询排序
        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder().query(QueryBuilders.matchAllQuery());
        //
        builder.sort("age", SortOrder.DESC);

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.11:过滤字段 builder.fetchSource(includes, excludes);

        // 5. 过滤字段
        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder().query(QueryBuilders.matchAllQuery());
        //
        String[] excludes = {"age"};
        String[] includes = {};
        builder.fetchSource(includes, excludes);

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.12:组合查询 :

     // 6. 组合查询
        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder();
        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();

        //boolQueryBuilder.must(QueryBuilders.matchQuery("age", 30));
        //boolQueryBuilder.must(QueryBuilders.matchQuery("sex", "男"));
        //boolQueryBuilder.mustNot(QueryBuilders.matchQuery("sex", "男"));
        boolQueryBuilder.should(QueryBuilders.matchQuery("age", 30));
        boolQueryBuilder.should(QueryBuilders.matchQuery("age", 40));

        builder.query(boolQueryBuilder);

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.13:范围查询 : QueryBuilders.rangeQuery("age");

        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder();
        RangeQueryBuilder rangeQuery = QueryBuilders.rangeQuery("age");

        rangeQuery.gte(30);
        rangeQuery.lt(50);

        builder.query(rangeQuery);

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.14:模糊查询:QueryBuilders.fuzzyQuery("name","wangwu").fuzziness(Fuzziness.TWO)

Fuzziness.TWO:意思就是字符差两个就可以查出来,代表模糊的范围

        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder();
        builder.query(QueryBuilders.fuzzyQuery("name", "wangwu").fuzziness(Fuzziness.TWO));

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.15:高亮查询:

        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder();
        TermsQueryBuilder termsQueryBuilder = QueryBuilders.termsQuery("name", "zhangsan");

        HighlightBuilder highlightBuilder = new HighlightBuilder();
        highlightBuilder.preTags("<font color='red'>");
        highlightBuilder.postTags("</font>");
        highlightBuilder.field("name");

        builder.highlighter(highlightBuilder);
        builder.query(termsQueryBuilder);

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.16:聚合查询:(求最大最小)对age字段取最大:maxAge

        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder();

        AggregationBuilder aggregationBuilder = AggregationBuilders.max("maxAge").field("age");
        builder.aggregation(aggregationBuilder);

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

3.17:分组查询 terms(“ageGroup”).field(“age”);: 根据年龄分组

        SearchRequest request = new SearchRequest();
        request.indices("user");

        SearchSourceBuilder builder = new SearchSourceBuilder();

        AggregationBuilder aggregationBuilder = AggregationBuilders.terms("ageGroup").field("age");
        builder.aggregation(aggregationBuilder);

        request.source(builder);
        SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);

        SearchHits hits = response.getHits();

        System.out.println(hits.getTotalHits());
        System.out.println(response.getTook());

        for ( SearchHit hit : hits ) {
            System.out.println(hit.getSourceAsString());
        }

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

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

相关文章

分布式全局唯一ID生成方案(附源码)

1、概述 ID&#xff0c;全称Identifier&#xff0c;中文翻译为标识符&#xff0c;是用来唯一标识对象或记录的符号。比如我们每个人都有自己的身份证号&#xff0c;这个就是我们的标识符&#xff0c;有了这个唯一标识&#xff0c;就能快速识别出每一个人。 在计算机世界里&…

客快物流大数据项目(八十八):ClickHouse快速入门

文章目录 ClickHouse快速入门 一、​​​​​​​​​​​​​​安装ClickHouse&#xff08;单机&#xff09; 1、安装yum-utils工具包 2、添加ClickHouse的yum源 3、安装ClickHouse的服务端和客户端 4、关于安装的说明 5、查看ClickHouse的版本信息 二、在命令行中操作…

【深度思考】5年开发经验,不知道git rebase,是否应该被嘲笑?

最近逛脉脉&#xff0c;发现了一个热度挺高的帖子&#xff0c;一位同学发帖说&#xff1a;同事5年经验&#xff0c;竟然不知道git rebase&#xff0c;真牛批 ☆ 今天咱们不讨论git rebase是干什么用的&#xff0c;因为讨论半天可能三两句话就说出来了&#xff0c;实在没有意思&…

Linux的进程互调技术(多语言互调)

Linux的进程互调技术(多语言互调) 文章目录Linux的进程互调技术(多语言互调)1.函数与进程之间的相似性2.多语言程序互调技术1.函数与进程之间的相似性 如果你学过C语言&#xff0c;你应该有以下认识&#xff1a; 一个C程序由很多函数组成&#xff0c;一个函数可以调用另一个函数…

STC 51单片机42——汇编 定时器 舵机

ORG 0000H HighH EQU 30H; 定义变量&#xff0c;高电平高八位 TimerH EQU 31H; 定义变量&#xff0c;高电平高八位定时值 TimerL EQU 32H; 定义变量&#xff0c;高电平低八位定时值 Right BIT P2.0 ; 右转 Left BIT P2.1 ; 左转 N…

IDEA搭建SSM框架【配置类、新手向】

以下操作基于2020.3企业版 1.创建Java Enterprise项目 直接默认即可 输入项目相关信息 点击完成后&#xff0c;得到以下目录结构 2.搭建项目目录结构 java目录下 controller&#xff1a;实现控制转发&#xff0c;基本参数校验&#xff0c;不复杂的简单业务处理 config&#x…

SpringBoot实现多数据源(一)【普通版切换】

在实际开发中&#xff0c;经常可能遇到在一个应用中可能需要访问多个数据库的情况。以下是两种典型场景 业务复杂&#xff08;数据量大&#xff09; 数据分布在不同的数据库中&#xff0c;数据库拆了&#xff0c;应用没拆。一个公司多个子项目&#xff0c;各用各的数据库&#…

Springboot——拦截器

目录 一、拦截器概念 二、拦截器的使用 2.1 拦截器的创建&#xff08;preHandle实用性最强&#xff09; 2.2 将拦截器添加到容器当中 三、拦截器参数 3.1 获取请求头 request.getHeader 3.2 Object handler 是什么参数 3.3 ModelAndView modelAndView 3.4 Exception ex 3.…

多重定义的全局符号,链接器会如何链接的情况

多重定义的全局符号&#xff0c;链接器会如何链接的情况实例1&#xff1a;1.规则12.规则13.规则24.规则3实例2总结以下只针对于gcc编译器&#xff0c;而且不同环境&#xff0c;不同编译器的情况可能不同。 假如说有多重定义的全局符号&#xff0c;链接器会如何链接呐&#xff…

[论文评析]AdaptivePose: Human Parts as Adaptive Points,AAAI 2022

AdaptivePose: Human Parts as Adaptive Points文章信息背景AdaptivePose身体表示方法Body RepresentationAdaptivePosePart Perception ModuleEnhanced Center-aware BranchTwo-hop Regression BranchLoss function推理Inference总结References文章信息 论文题目&#xff1a;…

Spring Boot JPA 存储库派生查询示例

在之前的文章中&#xff0c;您已经知道如何使用JPQL和本机查询通过注释从数据库中检索数据。今天&#xff0c;我将向您展示如何使用派生查询方法在 Spring 引导中实现 Spring Data JPA 存储库查询&#xff1a;Query 派生查询方法的结构配置 Spring 引导应用程序以使用不同的数…

【教学类-19-02】20221127《ABCABC式-规律排序-A4竖版2份》(中班)

展示效果&#xff1a; 单人使用样式&#xff1a; 单页打印样式 ​ 背景需求&#xff1a; 中班幼儿需要掌握ABCABC的排序规律 ​ 前文制作了ABAB单元格色块&#xff0c;微调word表格的列数&#xff0c;调整python的参数&#xff0c;随机生成ABC排序样式&#xff0c;引导幼儿…

Android 单ABI架构适配指南:保姆级教学 INSTALL_FAILED_NO_MATCHING_ABIS

单ABI架构 64位 安装报错误详情如下 &#xff1a; Installation did not succeed. The application could not be installed: INSTALL_FAILED_NO_MATCHING_ABIS 产品需求&#xff1a; 单ABI架构支持拆解 迎合市场需求 32/64位独立包 目前项目ABI架构如下&#xff1a; …

基于Mxnet实现语义分割-整体多模型【完整、附部分源码】

文章目录前言语义分割发展史及意义一、数据集的准备二、基于Mxnet的语义分割框架构建1.引入库2.CPU/GPU配置3.数据标准化4.解析数据集到列表中JSON格式Label 图像的标注格式5.设置数据迭代器6.模型构建fcn模型结构pspnet模型结构deeplabv3模型结构deeplabv3模型结构ICNet模型结…

刷爆力扣之构建乘积数组

刷爆力扣之构建乘积数组 HELLO&#xff0c;各位看官大大好&#xff0c;我是阿呆 &#x1f648;&#x1f648;&#x1f648; 今天阿呆继续记录下力扣刷题过程&#xff0c;收录在专栏算法中 &#x1f61c;&#x1f61c;&#x1f61c; 该专栏按照不同类别标签进行刷题&#xff0c…

合作对策模型的简单实现

以如下题目作为示例&#xff1a; 一位歌手(S)&#xff0c;一位钢琴家 (P) 和一位鼓手(D) 组成一个小乐队在俱乐部同台演出能得到演出费1000元&#xff0c;若歌手和钢琴家一起演出能得800元。而只有钢琴家和鼓手一起演出能得到650元&#xff0c;钢琴独奏表演能得300元&#xff…

表单与列表在HTML与CSS中是这么玩的

文章目录表单应用场景实例讲解表单描述标签的使用 label表单约束属性详解表单访问限制技巧常用字段类型扩展隐藏与表单提交技巧表单验证使用总结大文本与列表框技巧详解选项框标准打开方式文件上传的正确打开方式时期与时间表单项使用详解搜索表单与DATALIST数据列表表单历史数…

【Java多线程】线程状态及线程方法大全

➤ Java多线程编程【一文全解】 文章目录线程状态线程方法> 停止线程 stop( )> 线程休眠 sleep( )> 线程礼让 yield( )> 线程强行执行 join( )> 线程状态观测 Thread.State> 线程的优先级 Priority> 守护多线程 daemon线程状态 线程有五大状态: 创建状态…

Java代码审计——XML 外部实体注入(XXE)

目录 前言&#xff1a; &#xff08;一&#xff09;XML 的常见接口 1&#xff0e;XMLReader 2&#xff0e;SAXBuilder 3&#xff0e;SAXReader 4&#xff0e;SAXParserFactory 5&#xff0e;Digester 6&#xff0e;DocumentBuilderFactory (二&#xff09;XXE 漏洞审计…

MongoDB的安装

配置环境变量,将F:\MongoDB\Server\bin的路径添加到PATH环境变量中配置环境变量,将F:\MongoDB\Server\bin的路径添加到PATH环境变量中 1、下载 在安装数据库之前将所有杀毒软件、防护软件全部关闭掉 官网下载地址&#xff1a;Download MongoDB Community Server | MongoDB …