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
6
votes
1 answer

Is @DocumentId required for Hibernate Search?

I'm using Hibernate Search and the documentation and books say I need @DocumentId on the id field so that Hibernate Search can know how to map the index to the objects. My code appears to be working fine without the @DocumentId anywhere in my code.…
jackcrews
  • 125
  • 1
  • 7
5
votes
2 answers

Hibernate Search @IndexedEmbedded

I have a similar situation like this one @Entity @Indexed public class Place { @Id @GeneratedValue @DocumentId private Long id; @Field( index = Index.TOKENIZED ) private String name; @OneToOne( cascade = {…
Hons
  • 3,804
  • 3
  • 32
  • 50
5
votes
2 answers

Error while starting Hibernate Search in Web app

can someone help, I placing hibernate search in my web app and getting the following error:
Noor
  • 19,638
  • 38
  • 136
  • 254
5
votes
1 answer

How to configure type name or filter by type query with Elasticsearch integration?

I'm using Hibernate Search with Elasticsearch integration with the versions 5.8.2 and 5.6 respectively. Let's say I have 2 applications which use the same database and I want to search for Person entity. Both of the applications will update indexes…
sedooe
  • 3,100
  • 2
  • 22
  • 27
5
votes
0 answers

HibernateSearch ClassBridge - sorting and faceting not working with HS 5.5.1

I posted this a while ago in the hibernate search forum and got no response, so trying again in stackoverflow... Since migrating from HS 4.5.1 to HS 5.5.1 we have problems with sorting and faceting. All our indexing is done using a class bridge…
annamaria
  • 51
  • 3
5
votes
1 answer

Combine JPA with HIbernate Search Lucene Query

I can easily search my JPA entities with a fulltext query using Hibernate Search: FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(this.entityManager); QueryBuilder queryBuilder =…
Giovanni Lovato
  • 2,183
  • 2
  • 29
  • 53
5
votes
3 answers

Database needed with elasticsearch?

I've been doing a lot of research in regards to elasticsearch and I seem to be stumbling on the question of whether or not a database is needed. Current Hibernate-Search and Relational Design My current application is written in java using…
5
votes
1 answer

Filter full text search results by userId field with hibernate

Suppose I have 2 entities annotated for full text search: @Entity public class User implements Serializable { @Id public Long id; ... } @Entity @Indexed public class Post { @Id public Long id; @Field(name =…
user1079877
  • 9,008
  • 4
  • 43
  • 54
5
votes
1 answer

Hibernate Search 5.0 Numeric Lucene Query HSEARCH000233 issue

Issue: how do we provide hibernate search with a raw lucene query string that includes numeric and non-numeric fields? Background: we recently upgraded to HibernateSearch 5.0 and many of our queries are now failing because of a change in the…
adam
  • 1,067
  • 11
  • 24
5
votes
3 answers

Hibernate Full text Search Pagination

I am using Hibernate Fulltext search. I am currently using: org.hibernate hibernate-search 4.5.1.Final I am able to search all right. The…
Abhishek Ranjan
  • 911
  • 1
  • 14
  • 29
5
votes
2 answers

Boolean queries in Hibernate Search

I am trying to understand queries in general in Hibernate Search. I have some trouble understanding the forEntity(...) method. This is what the documentation says: Let's see how to use the API. You first need to create a query builder that is…
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
5
votes
2 answers

Spring Boot, Hibernate Search properties

How to provide Hibernate Search parameters when using Spring…
retromuz
  • 809
  • 9
  • 26
5
votes
3 answers

index not updating after external entity changes

I'm currently working on a project to persist data with JPA 2.1 and to search entities using hibernate search 4.5.0.final. After mapping classes and indexing, the searching works fine. However, when I changed the value description of classB from…
Kyne H
  • 133
  • 1
  • 7
5
votes
1 answer

lucene index not getting sync when any update occurs in DB through hibernate

I am working on some POC stuff on Hibernate Search based on Lucene using below env: hibernate-search-engine-4.4.2.Final.jar lucene-core-3.6.2.jar MySQL 5.5 Use @Indexed annotation on domain class. Use @Field(index=Index.YES, analyze=Analyze.YES,…
Atul Kumar
  • 719
  • 3
  • 8
  • 29
5
votes
2 answers

Lucene / Hibernate Search Lock Exception

I use Hibernate Search to index and full-text search items on a web application, problem-less! From my…
Wizche
  • 893
  • 13
  • 32
1 2
3
97 98