• Stars
    star
    493
  • Rank 89,306 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 14 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hibernate Search: full-text search for domain model

Hibernate Search

Maven Central Build Status Sonar Coverage Quality gate Develocity

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 GNU Lesser General Public License (LGPL), version 2.1 or later.

See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.

Getting started

Getting started guides are available here.

Fore more information, refer to the Hibernate Search website:

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

Contact

Latest Documentation

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

Bug Reports

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

Community Support

See http://hibernate.org/community/.

Contributing

New contributors are always welcome.

See CONTRIBUTING.md to get started.

The contribution guide also includes build instructions.

More Repositories

1

hibernate-orm

Hibernate's core Object/Relational Mapping functionality
Java
5,973
star
2

hibernate-validator

Hibernate Validator - Jakarta Bean Validation Reference Implementation
Java
1,200
star
3

hibernate-reactive

A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.
Java
437
star
4

hibernate-ogm

Hibernate OGM - Domain model persistence for NoSQL datastores
Java
321
star
5

hibernate-tools

Code generation, reverse engineering, ant task and more tools for Hibernate Core
Java
299
star
6

hibernate-demos

Repository for demos of various Hibernate projects
Java
282
star
7

hibernate-shards

Horizontal partitioning for Hibernate O/RM
Java
93
star
8

query-validator

Compile time validation for HQL and JPQL queries in Java code
Java
82
star
9

hibernate-test-case-templates

Templates and examples to report issues to Hibernate
Java
60
star
10

gradle-maven-publish-auth

Gradle plugin for managing authentication of upload tasks
Java
45
star
11

hibernate-metamodelgen

Annotation Processor to generate JPA 2 static metamodel classes
Java
33
star
12

hibernate-jpa-api

Clean-room definition of JPA APIs intended for transitory use in Hibernate JPA development
32
star
13

hibernate-hql-parser

New experimental parser for JP-QL queries
Java
30
star
14

hibernate-commons-annotations

Hibernate Commons Annotations project
Java
29
star
15

hibernate.org

Source for the hibernate.org website
JavaScript
27
star
16

hibernate-ogm-ignite

Hibernate OGM dialect for Apache Ignite
Java
16
star
17

hibernate-ogm-cassandra

Hibernate OGM integration with Cassandra
Java
11
star
18

hibernate.github.io

Legacy GitHub Pages deployment for https://hibernate.org. This repository is obsolete and is not longer used.
HTML
8
star
19

hibernate-infra

Configuration of Hibernate project infrastructure: CI, websites, bot deployment.
Shell
8
star
20

hibernate-semantic-query

Semantic query model and interpreter for HQL/JPQL and JPA Criteria queries
Java
8
star
21

hibernate-ide-codestyles

IDE code-styles for Hibernate projects
7
star
22

lucene-jbossmodules

Repackaging the Apache Lucene libraries to be deployed as modules in WildFly
Java
7
star
23

hibernate-ogm-redis

Hibernate OGM integration with Redis
Java
6
star
24

in.relation.to

Source for the in.relation.to website
HTML
5
star
25

hibernate-matrix-testing

Support for running tests against a number of database profiles
Java
4
star
26

gradle-xjc-plugin

A Gradle plugin for performing XJC for generating a JAXB binding model from an XSD
Java
4
star
27

hibernate-presentations

Hibernate presentations
Ruby
4
star
28

version-injection-plugin

Gradle plugin used by Hibernate to inject project version into compiled classes
Java
4
star
29

jakarta-transformer-plugin

Java
3
star
30

hibernate-jenkins-pipeline-helpers

Hibernate helpers for Jenkins pipelines
Groovy
3
star
31

quarkus-local-cache

A Hibernate Cache optimised for Quarkus
3
star
32

beanvalidation-benchmark

A benchmark for Bean Validation implementations
Java
3
star
33

hibernate-ogm-couchdb

Hibernate OGM integration with CouchDB
Java
3
star
34

hibernate-asciidoctor-extensions

Asciidoctor extensions developed for the Hibernate projects
Java
3
star
35

gson-jbossmodules

Repackaging the Gson libraries to be deployed as modules in WildFly
Java
2
star
36

hibernate-ogm-ehcache

Hibernate OGM integration with EhCache
Java
2
star
37

elasticsearch-client-jbossmodules

Repackaging the Elasticsearch client libraries to be deployed as modules in WildFly
Java
2
star
38

hibernate-noorm-release-scripts

Older release scripts for Hibernate projects (except Hibernate ORM). DEPRECATED: Use https://github.com/hibernate/hibernate-release-scripts instead
Shell
2
star
39

hibernate-models

An abstraction over "reflection" and annotations
Java
2
star
40

docs.hibernate.org

Documentation website for the Hibernate projects
1
star
41

hibernate-jdocbook-style

Documentation style
XSLT
1
star
42

hibernate-search-benchmark

Benchmarks for performance testing of Hibernate Search.
Java
1
star
43

database-profile-plugin

Support for testing against multiple databases via profiles
Java
1
star
44

hibernate-search-6-poc

Content was moved to https://github.com/hibernate/hibernate-search/. See readme for more information.
1
star
45

aws-v4-signer-java-jbossmodules

Java
1
star
46

hibernate-github-bot

A bot to handle GitHub events from repositories of the Hibernate organization
Java
1
star
47

hibernate-release-scripts

Shell
1
star
48

hibernate-search-develocity-extension

A Maven extension to configure Develocity build cache for the Hibernate Search project
Java
1
star