Skip to content
프로젝트

소개

Hibernate Search: 도메인 모델을 위한 전문 검색

데이터 및 분석

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Hibernate Search

Maven Central Build Status Sonar Coverage Quality gate Develocity Reproducible Builds

Description

Hibernate Search automatically extracts data from Hibernate ORM entities to push it to local Apache Lucene indexes or remote Elasticsearch/OpenSearch indexes.

It features:

For example, map your entities like this:

@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
    // ...
}

Index existing data like this:

SearchSession searchSession = Search.session( entityManager );
MassIndexer indexer = searchSession.massIndexer( Book.class );
indexer.startAndWait();

Listener-triggered indexing does not require any change to code based on JPA or Hibernate ORM:

Author author = new Author();
author.setName( "Isaac Asimov" );

Book book = new Book();
book.setTitle( "The Caves Of Steel" );
book.getAuthors().add( author );
author.getBooks().add( book );

entityManager.persist( author );
entityManager.persist( book );

And search like this:

SearchResult<Book> result = Search.session( entityManager )
        .search( Book.class )
        .where( f -> f.match()
                .fields( "title", "authors.name" )
                .matching( "Isaac" ) )
        .fetch( 20 );

List<Book> hits = result.hits();
long totalHitCount = result.total().hitCount();

License

This software and its documentation are distributed under the terms of the Apache License version 2.0 (Apache-2.0).

The Apache-2.0 license text is included verbatim in the LICENSE.txt file in the root directory of the repository.

Note that Hibernate Search 7.2.0.Alpha1 and lower are distributed under a different license; for more information, check the licensing information provided alongside published binaries, or the corresponding branch in the source repository.

Getting started

Getting started guides are available here.

Fore more information, refer to the Hibernate Search website:

Contact

Latest Documentation

See https://hibernate.org/search/documentation/.

Bug Reports

See the HSEARCH project on the Hibernate JIRA instance: https://hibernate.atlassian.net/browse/HSEARCH.

Community Support

See https://hibernate.org/community/.

Contributing

New contributors are always welcome.

See CONTRIBUTING.md to get started.

The contribution guide also includes build instructions.

관련 프로젝트 살펴보기

불러오는 중…