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
0 answers

Integrating Hibernate search With Spring

Can any one help me in integrating Hibernate search for folder searching. With configuration setting i tried for annotation based where as i have to search the folders containing pdf files. It will be helpful if any reference is available.
nani
  • 21
  • 2
2
votes
1 answer

Lucene/Hibernate Search - Query associated collections?

I'm writing a Seam-based application, making use of JPA/Hibernate and Hibernate Search (Lucene). I have an object called Item that has a many-to-many relation to an object Keyword. It looks like this (some annotations omitted): @Indexed public…
Shadowman
  • 11,150
  • 19
  • 100
  • 198
2
votes
1 answer

how to integrate magnolia cms with hibernate search?

Did somebody manage to get a working application which included these 2 frameworks? The problem I'm facing is that the dependencies are like this: magnolia 4.4.5 -> apache jackrabbit 1.6.4 -> apache lucene 2.4.1 hibernate search 3.4.1.Final ->…
2
votes
3 answers

Merging Hibernate Search results with relational database query

I have a complex query that requires a full-text search on some fields and basic restrictions on other fields. Hibernate Search documentation strongly advises against adding database query restrictions to a full text search query and instead…
Rob H
  • 14,502
  • 8
  • 42
  • 45
2
votes
1 answer

Hibernate HQL query does not update the Lucene Index

I am using Hibernate 3.6.3 Final and Hibernate Search 3.4.1. I wrote an HQL delete query. The objects are deleted from the database but they are not removed from the Lucene Index after the transaction completes. Here is the query: Session session =…
2
votes
1 answer

Hibernate Search - Start application even if Elasticsearch cluster is down

We integrated hibernate search into our crud microservices (simple spring boot apps) and it works like a charm. One fact that makes our architects nervous is that the crud services refuse to start when Elasticsearch is not running. Is there any way…
padmalcom
  • 1,156
  • 3
  • 16
  • 30
2
votes
1 answer

Generate @Indexed annotation using Jaxb or HyperJaxb

I want to implement lucene based hibernate search in my assignment. For generating domain objects I am using HyperJaxb3. I want @Indexed annotation to be added during domain object creation using HyperJaxb. I tried googling for this, but unable to…
suhas khot
  • 85
  • 1
  • 12
2
votes
2 answers

Using Hibernate Search (Lucene), I Need to Be Able to Search a Code With or Without Dashes

This is really the same as it would be for a social security #. If I have a code with this format: WHO-S-09-0003 I want to be able to do: query = qb.keyword().onFields("key").matching("WHOS090003").createQuery(); I tried using a…
Rob
  • 11,446
  • 7
  • 39
  • 57
2
votes
1 answer

Cannot define analyzer in hibernate search 6

I define an analyzer on hibernate search 6 public class MyLuceneAnalysisConfigurer implements LuceneAnalysisConfigurer { @Override public void configure(LuceneAnalysisConfigurationContext context) { context.analyzer( "english"…
Ibrahim
  • 23
  • 3
2
votes
1 answer

How to collapse duplicates in search results

We use Hibernate Search 6 CR2 with Elasticsearch and Spring Boot 2.4.0. Is there any way to collapse duplicates in search results? We tried to kind of "collapse" them like this: searchResults = searchSession.search(Items.class) …
Artemoon
  • 125
  • 1
  • 1
  • 9
2
votes
2 answers

what analzyer is good for my situation? hibernate search case

We are running a search app for book. It is implemented by hibernate search. Book entity is defined as following: @Entity @Indexed public class Book{ @DocumentId private Integer UID; @Field private String title; @Field private String…
Ej Huang
  • 152
  • 1
  • 1
  • 6
2
votes
1 answer

Exclude document(s) if condition true

I have three fields in an entity: establishmentNameEn IsTelPublishDa isTelSecret I have fuzzy search on establishmentNameEn. And now i want to apply condition to exclude document(s) if field IsTelPublishDa value is 0 or isTelSecret value is 1. My…
Kamran Ullah
  • 101
  • 9
2
votes
1 answer

Error on using a custom bridge of hibernate-search

I have two entities: @Indexed @Entity @Table(name = "LK_CONTACT_TYPE") public class ContactTypeEntity { @Id @Column(name = "ID") @DocumentId Integer id; @SortableField @Field(store = Store.YES, bridge = @FieldBridge(impl =…
Kamran Ullah
  • 101
  • 9
2
votes
1 answer

How to index a inherited field in Hibernate-search?

I am working in a java jpa Hibernate-search application, I know Hibernate-search index automatically every @Id annotation in an entity. The problem is that I have a "master domain" class with contains the @Id annotation, and then I have another…
alexcornejo
  • 163
  • 1
  • 12
2
votes
1 answer

Hibernate Search: how to configure index for JPA entity dynamically?

I have two applications which use the same Elasticsearch instance as a search engine. Both applications share the same code base and have only minor differences. Applications run against different databases, and hence, the different ES indices…
Dzmitry Bahdanovich
  • 1,735
  • 2
  • 17
  • 34