国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Elasticsearch8.x版本中RestHighLevelClient被棄用,新版本中全新的Java客戶端Elasticsearch Java API Client中常用API練習(xí)

這篇具有很好參考價(jià)值的文章主要介紹了Elasticsearch8.x版本中RestHighLevelClient被棄用,新版本中全新的Java客戶端Elasticsearch Java API Client中常用API練習(xí)。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

Es的java API客戶端

在Es7.15版本之后,es官方將它的高級(jí)客戶端RestHighLevelClient標(biāo)記為棄用狀態(tài)。同時(shí)推出了全新的java API客戶端Elasticsearch Java API Client,該客戶端也將在Elasticsearch8.0及以后版本中成為官方推薦使用的客戶端。

Elasticsearch Java API Client支持除Vector title search API和Find structure API之外的所有Elasticsearch API。且支持所有API數(shù)據(jù)類型,并且不再有原始JSON Value屬性。它是針對Elasticsearch8.0及之后版本的客戶端。

感興趣的小伙伴可以去官方文檔看看:Elasticsearch官網(wǎng)8.x版本下Java客戶端文檔

Elasticsearch Java API Client使用

  • 新建maven項(xiàng)目

  • maven中引入依賴坐標(biāo)

        <dependency>
            <groupId>co.elastic.clients</groupId>
            <artifactId>elasticsearch-java</artifactId>
            <version>8.1.0</version>
        </dependency>
         <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.13.1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.22</version>
            <scope>provided</scope>
        </dependency>
  • 創(chuàng)建連接
    @Test
    public void create() throws IOException {
        // 創(chuàng)建低級(jí)客戶端
        RestClient restClient = RestClient.builder(
                new HttpHost("localhost", 9200)
        ).build();
        // 使用Jackson映射器創(chuàng)建傳輸層
        ElasticsearchTransport transport = new RestClientTransport(
                restClient, new JacksonJsonpMapper()
        );
        // 創(chuàng)建API客戶端
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 關(guān)閉ES客戶端
        transport.close();
        restClient.close();
    }

索引index的基本語法

  • 創(chuàng)建索引
    @Test
    public void create() throws IOException {
        // 創(chuàng)建低級(jí)客戶端
        RestClient restClient = RestClient.builder(
                new HttpHost("localhost", 9200)
        ).build();
        // 使用Jackson映射器創(chuàng)建傳輸層
        ElasticsearchTransport transport = new RestClientTransport(
                restClient, new JacksonJsonpMapper()
        );
        // 創(chuàng)建API客戶端
        ElasticsearchClient client = new ElasticsearchClient(transport);
        // 創(chuàng)建索引
        CreateIndexResponse createIndexResponse = client.indices().create(c -> c.index("user_test"));
        // 響應(yīng)狀態(tài)
        Boolean acknowledged = createIndexResponse.acknowledged();
        System.out.println("索引操作 = " + acknowledged);

        // 關(guān)閉ES客戶端
        transport.close();
        restClient.close();
    }
  • 查詢索引
    @Test
    public void query() throws IOException {
        RestClient restClient = RestClient.builder(
                new HttpHost("localhost",9200)
        ).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 查詢索引
        GetIndexResponse getIndexResponse = client.indices().get(e -> e.index("user_test"));
        System.out.println("getIndexResponse.result() = " + getIndexResponse.result());
        System.out.println("getIndexResponse.result().keySet() = " + getIndexResponse.result().keySet());

        transport.close();
        restClient.close();
    }

如果查詢的index不存在會(huì)在控制臺(tái)拋出index_not_found_exception

  • 刪除索引
    @Test
    public void delete() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 刪除索引
        DeleteIndexResponse deleteIndexResponse = client.indices().delete(e -> e.index("user_test"));
        System.out.println("刪除操作 = " + deleteIndexResponse.acknowledged());

        transport.close();
        restClient.close();
    }

文檔document的操作

  • 創(chuàng)建User對象
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private String name;
    private String sex;
    private Integer age;
}
  • 添加document
    @Test
    public void addDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 向user對象中添加數(shù)據(jù)
        User user = new User("java客戶端", "男", 18);
        // 向索引中添加數(shù)據(jù)
        CreateResponse createResponse = client.create(e -> e.index("user_test").id("1001").document(user));
        System.out.println("createResponse.result() = " + createResponse.result());

        transport.close();
        restClient.close();
    }

注:index中參數(shù)為文檔所屬的索引名,id中參數(shù)為當(dāng)文檔的id,document為文檔數(shù)據(jù),新版本支持直接傳入java對象。

  • 查詢document
    @Test
    public void queryDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 構(gòu)建請求
        GetResponse<User> getResponse = client.get(e -> e.index("user_test").id("1001"), User.class);
        System.out.println("getResponse.source().toString() = " + getResponse.source().toString());

        transport.close();
        restClient.close();
    }

注:如果查不到控制臺(tái)拋出NullPointerException

  • 修改document
    @Test
    public void modifyDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 使用map集合封裝需要修改的內(nèi)容
        Map<String, Object> map = new HashMap<>();
        map.put("name", "java客戶端aaa");
        // 構(gòu)建請求
        UpdateResponse<User> updateResponse = client.update(e -> e.index("user_test").id("1001").doc(map), User.class);
        System.out.println("updateResponse.result() = " + updateResponse.result());

        transport.close();
        restClient.close();
    }
  • 刪除document
    @Test
    public void removeDocument() throws  IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 構(gòu)建請求
        DeleteResponse deleteResponse = client.delete(e -> e.index("user_test").id("1001"));
        System.out.println("deleteResponse.result() = " + deleteResponse.result());

        transport.close();
        restClient.close();
    }
  • 批量添加document
    @Test
    public void batchAddDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 構(gòu)建一個(gè)批量數(shù)據(jù)集合
        List<BulkOperation> list = new ArrayList<>();
        list.add(new BulkOperation.Builder().create(
                d -> d.document(new User("test2", "男", 19)).id("1002").index("user_test")).build());
        list.add(new BulkOperation.Builder().create(
                d -> d.document(new User("test3", "男", 20)).id("1003").index("user_test")).build());
        list.add(new BulkOperation.Builder().create(
                d -> d.document(new User("test4", "女", 21)).id("1004").index("user_test")).build());
        // 調(diào)用bulk方法執(zhí)行批量插入操作
        BulkResponse bulkResponse = client.bulk(e -> e.index("user_test").operations(list));
        System.out.println("bulkResponse.items() = " + bulkResponse.items());

        transport.close();
        restClient.close();
    }

批量添加的核心是需要構(gòu)建一個(gè)泛型為BulkOperationArrayList集合,實(shí)質(zhì)上是將多個(gè)請求包裝到一個(gè)集合中,進(jìn)行統(tǒng)一請求,進(jìn)行構(gòu)建請求時(shí)調(diào)用bulk方法,實(shí)現(xiàn)批量添加效果。

  • 批量刪除
    @Test
    public void batchDeleteDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 構(gòu)建一個(gè)批量數(shù)據(jù)集合
        List<BulkOperation> list = new ArrayList<>();
        list.add(new BulkOperation.Builder().delete(
                d -> d.id("1002").index("user_test")).build());
        list.add(new BulkOperation.Builder().delete(
                d -> d.id("1003").index("user_test")).build());
        // 調(diào)用bulk方法執(zhí)行批量插入操作
        BulkResponse bulkResponse = client.bulk(e -> e.index("user_test").operations(list));
        System.out.println("bulkResponse.items() = " + bulkResponse.items());

        transport.close();
        restClient.close();
    }
  • 全量查詢
    @Test
    public void queryAllDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 全量查詢
        SearchResponse<User> searchResponse = client.search(e -> e.index("user_test").query(q -> q.matchAll(m -> m)), User.class);
        HitsMetadata<User> hits = searchResponse.hits();
        for (Hit<User> hit : hits.hits()) {
            System.out.println("user = " + hit.source().toString());
        }
        System.out.println("searchResponse.hits().total().value() = " + searchResponse.hits().total().value());

        transport.close();
        restClient.close();
    }
  • 分頁查詢
    @Test
    public void pagingQueryDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 分頁查詢
        SearchResponse<User> searchResponse = client.search(
                s -> s.index("user_test")
                        .query(q -> q.matchAll(m -> m))
                        .from(2)
                        .size(2)
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }

分頁查詢就是在全量查詢的基礎(chǔ)上增加了從第幾條開始,每頁顯示幾條

  • 排序查詢
    @Test
    public void sortQueryDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 排序查詢
        SearchResponse<User> searchResponse = client.search(
                s -> s.index("user_test")
                        .query(q -> q.matchAll(m -> m))
                        .sort(o -> o.field(f -> f.field("age").order(SortOrder.Asc)))
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }
  • 條件查詢
    @Test
    public void conditionQueryDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 條件查詢
        SearchResponse<User> searchResponse = client.search(
                s -> s.index("user_test").query(q -> q.matchAll(m -> m))
                        .sort(o -> o.field(f -> f.field("age").order(SortOrder.Asc)))
                        .source(r -> r.filter(f -> f.includes("name", "age").excludes("")))
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }

includes是顯示的字段,excludes是排除的字段

  • 組合查詢
    @Test
    public void combinationQueryDocument() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 組合查詢
        SearchResponse<User> searchResponse = client.search(
                s -> s.index("user_test").query(q -> q.bool(b -> b
                        .must(m -> m.match(u -> u.field("age").query(21)))
                        .must(m -> m.match(u -> u.field("sex").query("男")))
                        .mustNot(m -> m.match(u -> u.field("sex").query("女")))
                ))
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }
    @Test
    public void combinationQueryDocument2() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 組合查詢
        SearchResponse<User> searchResponse = client.search(
                s -> s.index("user_test").query(q -> q.bool(b -> b
                        .should(h -> h.match(u -> u.field("age").query(19)))
                        .should(h -> h.match(u -> u.field("sex").query("男")))
                ))
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }

must是必須滿足所有條件,should只要滿足一個(gè)就行

  • 范圍查詢
    @Test
    public void scopeQueryDocument2() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 范圍查詢,gte()表示取大于等于,gt()表示大于,lte()表示小于等于
        SearchResponse<User> searchResponse = client.search(s -> s.index("user_test").query(q -> q
                        .range(r -> r.field("age").gte(JsonData.of(20)).lt(JsonData.of(21))))
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }
  • 模糊查詢
    @Test
    public void fuzzyQueryDocument2() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 模糊查詢,fuzziness表示差幾個(gè)可以查詢出來
        SearchResponse<User> searchResponse = client.search(s -> s.index("user_test").query(q -> q
                        .fuzzy(f -> f.field("name").value("tst").fuzziness("2")))
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }
  • 高亮查詢
    @Test
    public void highlightQueryDocument2() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 高亮查詢
        SearchResponse<User> searchResponse = client.search(s -> s.index("user_test").query(q -> q
                        .term(t -> t.field("name").value("test3")))
                        .highlight(h -> h.fields("name", f -> f.preTags("<font color='red'>").postTags("</font>")))
                , User.class);
        searchResponse.hits().hits().forEach(h -> System.out.println(h.source().toString()));

        transport.close();
        restClient.close();
    }
  • 聚合查詢
    @Test
    public void aggregateQueryDocument2() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 聚合查詢,取最大年齡
        SearchResponse<User> searchResponse = client.search(s -> s.index("user_test").aggregations("maxAge", a ->a.max(m -> m.field("age")))
                , User.class);
        searchResponse.aggregations().entrySet().forEach(f -> System.out.println(f.getKey() + ":" + f.getValue().max().value()));

        transport.close();
        restClient.close();
    }
  • 分組查詢
    @Test
    public void groupQueryDocument2() throws IOException {
        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        ElasticsearchClient client = new ElasticsearchClient(transport);

        // 分組查詢
        SearchResponse<User> searchResponse = client.search(s -> s.index("user_test")
                        .aggregations("ageGroup", a ->a.terms(t -> t.field("age")))
                , User.class);
        searchResponse.aggregations().get("ageGroup").lterms().buckets().array().forEach(f -> System.out.println(f.key() + ":" + f.docCount()));

        transport.close();
        restClient.close();
    }

分組查詢實(shí)質(zhì)上是聚合查詢的一種

看到這里的小伙伴點(diǎn)個(gè)免費(fèi)的贊吧,感謝支持?。。?/strong>文章來源地址http://www.zghlxwxcb.cn/news/detail-403398.html

到了這里,關(guān)于Elasticsearch8.x版本中RestHighLevelClient被棄用,新版本中全新的Java客戶端Elasticsearch Java API Client中常用API練習(xí)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • vscode | linux | c++ intelliense 被棄用解決方案

    vscode | linux | c++ intelliense 被棄用解決方案

    每日一句,vscode用的爽是爽,主要是可配置太強(qiáng)了。如果也很會(huì)研究,可以直接去咸魚接單了 廢話少說,直接整。 用著用著說是c++ intelliense被棄用,很多輔助功能無法使用,像查看定義、查看引用、函數(shù)跳轉(zhuǎn)、智能提示…… 歸根結(jié)底,還是太菜了,但真的很需要這些輔助啊

    2024年02月12日
    瀏覽(79)
  • WebSecurityConfigurerAdapter被棄用Spring Security基于組件化的配置和使用

    WebSecurityConfigurerAdapter被棄用Spring Security基于組件化的配置和使用

    在Spring Security 5.7及之后的版本中 WebSecurityConfigurerAdapter 將被啟用,安全框架將轉(zhuǎn)向基于組件的安全配置。 spring security官方文檔 Spring Security without the WebSecurityConfigurerAdapter 如果使用的Spring Boot版本高于低于2.7.0、Spring Security版本高于5.7,就會(huì)出現(xiàn)如下的提示: 1、被啟用的原因

    2024年02月02日
    瀏覽(23)
  • Android Handler被棄用,那么以后怎么使用Handler,或者類似的功能

    Android Handler被棄用,那么以后怎么使用Handler,或者類似的功能

    Android API30左右,Android應(yīng)用在使用傳統(tǒng)寫法使用Handler類的時(shí)候會(huì)顯示刪除線,并提示相關(guān)的方法已經(jīng)被棄用,不建議使用。 Android studio中的顯示和建議: 看下官方API關(guān)于此處的解釋: ?簡要說就是如果在實(shí)例化Handler的時(shí)候不提供Looper, 可能導(dǎo)致操作丟失(Handler 沒有預(yù)估到新

    2023年04月21日
    瀏覽(27)
  • Unity打包APK錯(cuò)誤:‘a(chǎn)ndroid.enableR8‘選項(xiàng)已被棄用,不應(yīng)再使用

    Unity打包APK錯(cuò)誤:\\\'android.enableR8’選項(xiàng)已被棄用,不應(yīng)再使用 在Unity游戲開發(fā)中,我們經(jīng)常需要將游戲打包成APK文件以在Android設(shè)備上進(jìn)行測試或發(fā)布。然而,有時(shí)候在打包APK的過程中,可能會(huì)遇到一些錯(cuò)誤。其中一個(gè)常見的錯(cuò)誤是 “The option ‘a(chǎn)ndroid.enableR8’ is deprecated and sh

    2024年02月08日
    瀏覽(93)
  • Python錯(cuò)題集-7:DeprecationWarning: Conversion of an array with ndim(被棄用警告)

    Python錯(cuò)題集-7:DeprecationWarning: Conversion of an array with ndim(被棄用警告)

    DeprecationWarning: Conversion of an array with ndim 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) ? X[i] = np.random.normal(loc=Ex, scale=np.abs(Enn), size=1) DeprecationWarning: Conversion of an array with ndim ?是一個(gè)警告,通常出

    2024年04月09日
    瀏覽(33)
  • iOS中獲取MCC和MNC的方法及iOS 16中CTCarrier被棄用的替代方案

    一、使用公共API獲取MCC和MNC 在iOS中,我們可以使用CoreTelephony框架來獲取用戶的移動(dòng)國家代碼(MCC)和移動(dòng)網(wǎng)絡(luò)代碼(MNC)。具體操作步驟如下: 在Xcode項(xiàng)目中,點(diǎn)擊項(xiàng)目目標(biāo),進(jìn)入“General”選項(xiàng)卡,在“Frameworks, Libraries, and Embedded Content”下點(diǎn)擊“+”按鈕,搜索并添加 Cor

    2024年02月11日
    瀏覽(85)
  • springBoot整合ElasticSearch8.x版本

    導(dǎo)入依賴 ? dependency ? ? ? ? groupIdcom.fasterxml.jackson.core/groupId ? ? ? ? artifactIdjackson-databind/artifactId ? ? ? ? version2.13.2/version ? /dependency ? ? dependency ? ? ? ? groupIdorg.glassfish/groupId ? ? ? ? artifactIdjakarta.json/artifactId ? ? ? ? version2.0.1/version ? /dependency ? ? ? ? ? dependency ?

    2023年04月21日
    瀏覽(27)
  • Elasticsearch8.x版本Java客戶端Elasticsearch Java API Client中常用API練習(xí)

    在Es7.15版本之后,es官方將它的高級(jí)客戶端RestHighLevelClient標(biāo)記為棄用狀態(tài)。同時(shí)推出了全新的java API客戶端Elasticsearch Java API Client,該客戶端也將在Elasticsearch8.0及以后版本中成為官方推薦使用的客戶端。 Elasticsearch Java API Client支持除Vector title search API和Find structure API之外的所有

    2024年04月11日
    瀏覽(25)
  • Elasticsearch-RestHighLevelClient基礎(chǔ)操作

    該篇文章參考下面博主文章 Java中ElasticSearch的各種查詢(普通,模糊,前綴,高亮,聚合,范圍) 【es】java使用es中三種查詢用法from size、search after、scroll 刪除索引會(huì)把索引中已經(jīng)創(chuàng)建好的數(shù)據(jù)也刪除,就好像我們在mysql中刪除庫,會(huì)把庫的數(shù)據(jù)也刪除掉一樣。 類似關(guān)閉數(shù)據(jù)

    2024年02月08日
    瀏覽(25)
  • Elasticsearch8 - Docker安裝Elasticsearch8.12.2

    Elasticsearch8 - Docker安裝Elasticsearch8.12.2

    最近在學(xué)習(xí) ES,所以需要在服務(wù)器上裝一個(gè)單節(jié)點(diǎn)的 ES 服務(wù)器環(huán)境:centos 7.9 目前最新版本是 8.12.2 新增配置文件 elasticsearch.yml 解釋一下,前三行是開啟遠(yuǎn)程訪問和跨域,最后一行是開啟密碼訪問 Networking | Elasticsearch Guide [8.12] | Elastic 在宿主機(jī)創(chuàng)建容器的掛載目錄,我的目錄

    2024年04月15日
    瀏覽(31)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包