Questions tagged [hibernate-search]

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

Hibernate Search provides synchronization between entities managed by Hibernate ORM and full-text indexing services like Apache Lucene and Elasticsearch.

It will automatically apply changes to indexes, which is tedious and error prone coding work, while leaving you full control on the query aspects. The development community constantly researches and refines the index writing techniques to improve performance.

Mapping your objects to the indexes is declarative, using a combination of Hibernate Search specific annotations and the knowledge it can gather from your existing Hibernate/JPA mapping.

Queries can be defined by any combination of:

  • "native" Apache Lucene queries
  • writing "native" Elasticsearch queries in JSON format (if using Elasticsearch, which is optional)
  • using a DSL which abstracts the previous two generating optimal backend specific queries

Query results can include projections to be loaded directly from the index, or can materialize fully managed Hibernate entities loaded from the database within the current transactional scope.

Hibernate Search is using Apache Lucene under the cover; this can be used directly (running embedded in the same JVM) or remotely provided by an Elasticsearch server over its REST API.

Hibernate Search is open source and contributions are welcome both as patches or comments and suggestions.

For latest news follow the Hibernate team blog.

1466 questions
2
votes
1 answer

How to correctly use @ContainedIn annotation in Hibernate Search?

I'm using Hibernate with PostgreSQL and Hibernate Search (5.7.0.Alpha1) with ElasticSearch (2.4.2). I have two classes: Book and Author. A book can have many authors and an author can author more than one book. I annotated Book class like…
nuoritoveri
  • 2,494
  • 1
  • 24
  • 28
2
votes
1 answer

Hibernate Search - search in ManyToOne relation

I have two indexed entities. Player: @Indexed @Entity public class Player { @Field private String firstName; @ContainedIn @ManyToOne private Club playersClub; } and Club: @Indexed @Entity public class Club { @Fields({ …
proceder
  • 57
  • 1
  • 9
2
votes
0 answers

How to check values for null and not null together using Lucene Query?

How to check values for null and not null together using TermQuery? 1. TermQuery termQuery = new TermQuery(new Term("referencekuki.unit.name","Kuki")); 2. query.add(termQuery, BooleanClause.Occur.SHOULD); 3. BooleanQuery q = new BooleanQuery(); …
fatherazrael
  • 5,511
  • 16
  • 71
  • 155
2
votes
2 answers

Hibernate Search usage, when to use and why

I have a simply question, because today it was the first time I met and used Hibernate Search. Can somebody explain me simply what are the adventages of using Hibernate Search with JPA annotations, does it make sense to use it instead of Spring Data…
crooked
  • 675
  • 2
  • 11
  • 22
2
votes
2 answers

Using Hibernate-Search for Complex Queries instead of Criteria API

In an app using Wicket+Spring+JPA/Hibernate stack, I have an Inbox/Search page which should have quite complex search capabilities, where records saved in a database are filtered using a myriad of filtering options. So far I've used JPA Criteria API…
John Manak
  • 13,328
  • 29
  • 78
  • 119
2
votes
1 answer

Hibernate Criteria deprecation warrning after implementing Hibernate Search

For my web app I have to implement full text search - as I'm already using Hibernate with Spring Data JPA (on top of Spring Boot) I decided to implement Hibernate Search for full text Lucene queries. Everything works as expected but after…
2
votes
2 answers

Hibernate Search: Share index between applications

We are working on a JavaFX solution using Hibernate/JPA to access the database. We use Hibernate Search with Lucene to search for entities, which works quite well, as long as only one instance of the program is running. If a second instance is…
YellowSub
  • 179
  • 2
  • 11
2
votes
1 answer

Unable to find field with custom FieldBridge implementation

I can't seem to get the very basic FieldBridge implementation to work. It looks as if the indexing process is ignoring @FieldBridge annotation completely. Here's the implementation: public class LocalisedInformationBridge implements FieldBridge { …
tomz
  • 341
  • 3
  • 14
2
votes
0 answers

How to resolve Hibernate search [Lucene] OverlappingFileLockException

Getting below exception when doing multiple write operations in DB and simulataneously trying to search for the matching word. Index file is not updating, confirmed with Luke tool. Index file updates only after restarting the server. Please…
Vishwas Sampath
  • 113
  • 1
  • 2
  • 8
2
votes
1 answer

AnnotationSessionFactoryBean requires lucene classes

I am trying to add transaction support to an existing webapp via spring transactions. I recently changed my session factory class from LocalSessionFactoryBean to AnnotationSessionFactoryBean. now I get the following error when the webapp…
mkoryak
  • 57,086
  • 61
  • 201
  • 257
2
votes
3 answers

Hibernate 5 Search with Grails 3

I am using Grails 3.1.4 and I want use Hibernate-Search for full text search of my entities. In my build.gradle I have included Hibernate 5 and Hibernate Search compile "org.hibernate:hibernate-core:5.0.9.Final" compile…
Tobi
  • 2,001
  • 2
  • 27
  • 49
2
votes
1 answer

Spring Boot Hibernate Search Error

I have prepared an application in Spring Boot, demonstrating the use and the functioning of Hibernate Search. Problem/Error : When I try to run the application, it gives me an error : Exception in thread "main" java.lang.IllegalArgumentException:…
user6554564
2
votes
1 answer

How to do case insensitive sorting using Hibernate Lucene Search?

I am able to get results using following code but the results are not sorted correctly. It display lowercase first and then uppercase characters. Results getting: upper test UPPER Test Expected Results; upper UPPER Test test pattern can be…
fatherazrael
  • 5,511
  • 16
  • 71
  • 155
2
votes
3 answers

spring boot + hibernate search + elastic search embedded fails to start

I'm struggeling to setup hibernate seach using the elastic search backend in a spring boot setup. What I have is spring boot and the following dependencies. org.springframework.boot
Joey
  • 1,349
  • 14
  • 26
2
votes
1 answer

Hibernate Search starts with Wildfly 9 but not Wildfly 10

This is a Maven project with Hibernate Search. The Servlet works perfectly on Wildfly 9. As soon as I start it on Wildfly 10, I get a crash when Spring autowires the beans: ERROR [ContextLoader]:351 - Context initialization failed nested exception…
Guillaume F.
  • 5,905
  • 2
  • 31
  • 59