Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hibernate Search: full-text search for domain model

License

NotificationsYou must be signed in to change notification settings

hibernate/hibernate-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Maven CentralBuild StatusSonar CoverageQuality gateDevelocityReproducible Builds

Description

Hibernate Search automatically extracts data from Hibernate ORM entities to push it tolocalApache Lucene indexesor remoteElasticsearch/OpenSearch indexes.

It features:

For example, map your entities like this:

@Entity// This entity is mapped to an index@IndexedpublicclassBook {// The entity ID is the document ID@Id@GeneratedValueprivateIntegerid;// This property is mapped to a document field@FullTextFieldprivateStringtitle;@ManyToMany// Authors will be embedded in Book documents@IndexedEmbeddedprivateSet<Author>authors =newHashSet<>();// Getters and setters// ...}@EntitypublicclassAuthor {@Id@GeneratedValueprivateIntegerid;// This property is mapped to a document field@FullTextFieldprivateStringname;@ManyToMany(mappedBy ="authors")privateSet<Book>books =newHashSet<>();// Getters and setters// ...}

Index existing data like this:

SearchSessionsearchSession =Search.session(entityManager );MassIndexerindexer =searchSession.massIndexer(Book.class );indexer.startAndWait();

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

Authorauthor =newAuthor();author.setName("Isaac Asimov" );Bookbook =newBook();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();longtotalHitCount =result.total().hitCount();

License

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

The Apache-2.0 license text is included verbatim in theLICENSE.txt filein 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 thecorresponding branch in the source repository.

Getting started

Getting started guides are availablehere.

Fore more information, refer to the Hibernate Search website:

For offline use, distribution bundles downloaded fromSourceForgealso include the reference documentation for the downloaded version in PDF and HTML format.

Contact

Latest Documentation

Seehttps://hibernate.org/search/documentation/.

Bug Reports

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

Community Support

Seehttps://hibernate.org/community/.

Contributing

New contributors are always welcome.

SeeCONTRIBUTING.md to get started.

The contribution guide also includes build instructions.

About

Hibernate Search: full-text search for domain model

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp