Hibernate Search Mapper - JavaBean

Hibernate Search Mapper for POJOs following the JavaBean conventions

License

License

Categories

Categories

Hibernate Data ORM Search Business Logic Libraries
GroupId

GroupId

org.hibernate.search
ArtifactId

ArtifactId

hibernate-search-mapper-javabean
Last Version

Last Version

6.0.0.Beta4
Release Date

Release Date

Type

Type

jar
Description

Description

Hibernate Search Mapper - JavaBean
Hibernate Search Mapper for POJOs following the JavaBean conventions
Project Organization

Project Organization

Hibernate

Download hibernate-search-mapper-javabean

How to add to project

<!-- https://jarcasting.com/artifacts/org.hibernate.search/hibernate-search-mapper-javabean/ -->
<dependency>
    <groupId>org.hibernate.search</groupId>
    <artifactId>hibernate-search-mapper-javabean</artifactId>
    <version>6.0.0.Beta4</version>
</dependency>
// https://jarcasting.com/artifacts/org.hibernate.search/hibernate-search-mapper-javabean/
implementation 'org.hibernate.search:hibernate-search-mapper-javabean:6.0.0.Beta4'
// https://jarcasting.com/artifacts/org.hibernate.search/hibernate-search-mapper-javabean/
implementation ("org.hibernate.search:hibernate-search-mapper-javabean:6.0.0.Beta4")
'org.hibernate.search:hibernate-search-mapper-javabean:jar:6.0.0.Beta4'
<dependency org="org.hibernate.search" name="hibernate-search-mapper-javabean" rev="6.0.0.Beta4">
  <artifact name="hibernate-search-mapper-javabean" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.hibernate.search', module='hibernate-search-mapper-javabean', version='6.0.0.Beta4')
)
libraryDependencies += "org.hibernate.search" % "hibernate-search-mapper-javabean" % "6.0.0.Beta4"
[org.hibernate.search/hibernate-search-mapper-javabean "6.0.0.Beta4"]

Dependencies

compile (2)

Group / Artifact Type Version
org.hibernate.search : hibernate-search-mapper-pojo-base jar 6.0.0.Beta4
org.jboss.logging : jboss-logging jar 3.4.0.Final

provided (1)

Group / Artifact Type Version
org.jboss.logging : jboss-logging-annotations jar 2.2.0.Final

Project Modules

There are no modules declared in this project.

Hibernate Search

Maven Central Build Status Coverage Status Quality gate Language Grade: Java

Description

Hibernate Search automatically extracts data from Hibernate ORM entities to push it to local Apache Lucene indexes or remote Elasticsearch 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();

Automatic 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 FSF Lesser GNU Public License (see lgpl.txt).

Getting started

A getting started guide is available in the reference documentation.

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.

org.hibernate.search

Hibernate

Versions

Version
6.0.0.Beta4
6.0.0.Beta3
6.0.0.Beta2
6.0.0.Beta1
6.0.0.Alpha9
6.0.0.Alpha8
6.0.0.Alpha7
6.0.0.Alpha6
6.0.0.Alpha5
6.0.0.Alpha4
6.0.0.Alpha3
6.0.0.Alpha2
6.0.0.Alpha1