<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Hibernate SearchHibernate搜索框架

          聯(lián)合創(chuàng)作 · 2023-09-29 04:52

          Hibernate Search 的作用是對(duì)數(shù)據(jù)庫中的數(shù)據(jù)進(jìn)行檢索的。它是 hibernate 對(duì)著名的全文檢索系統(tǒng) Lucene 的一個(gè)集成方案,作用在于對(duì)數(shù)據(jù)表中某些內(nèi)容龐大的字段(如聲明為 text 的字段)建立全文索引,這樣通過 hibernate search 就可以對(duì)這些字段進(jìn)行全文檢索后獲得相應(yīng)的 POJO,從而加快了對(duì)內(nèi)容龐大字段進(jìn)行模糊搜索的速度(sql 語句中 like 匹配)。

          Hibernate Search 自動(dòng)從 Hibernate ORM 實(shí)體中提取數(shù)據(jù),以將其推送到本地 Apache Lucene 索引或遠(yuǎn)程 Elasticsearch 索引。

          Hibernate Search主要有以下功能特點(diǎn):

          @Entity
          // This entity is mapped to an index
          @Indexed
          public class Book {
          
              // The entity ID is the document ID
              @Id
              @GeneratedValue
              private Integer id;
          
              // This property is mapped to a document field
              @FullTextField
              private String title;
          
              @ManyToMany
              // Authors will be embedded in Book documents
              @IndexedEmbedded
              private Set<Author> authors = new HashSet<>();
          
              // Getters and setters
              // ...
          }
          
          @Entity
          public class Author {
          
              @Id
              @GeneratedValue
              private Integer id;
          
              // This property is mapped to a document field
              @FullTextField
              private String name;
          
              @ManyToMany(mappedBy = "authors")
              private Set<Book> books = new HashSet<>();
          
              // Getters and setters
              // ...
          }
          
          瀏覽 24
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  91国久久久 | 亚州在线无码视频 | 亚洲少妞视频 | 欧美深喉吞精 | 丰满熟女一区二区三区在线播放 |