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
28
votes
6 answers

Solr vs Hibernate Search - Which to choose and When?

We are building an ecommerce application. We are using JAVA stack with Hibernate and Spring Framework. As with all ecommerce application, we need to build search capability into ours. So, we came across Hibernate Search and Apache Solr . Can someone…
Lucky Murari
  • 12,672
  • 5
  • 22
  • 43
27
votes
5 answers

SaaS / Multi-Tenancy approaches for Java-based (GWT, Spring, Hibernate) web applications

I am currently looking into converting a single-tenant Java based web-app that uses Spring, GWT, Hibernate, Jackrabbit, Hibernate Search / Lucene (among others) into a fully fledged SaaS style app. I stumbled across an article that highlights the…
brent777
  • 3,369
  • 1
  • 26
  • 35
19
votes
1 answer

How to replace deprecated MultipleHiLoPerTableGenerator with TableGenerator in Hibernate

I use hibernate in an application with spring boot 1.4.0.RELEASE. The Entity for the index looks something along the lines of: @Entity(name = "SearchableTariffItem") @Indexed public class SearchableTariffItem { public static final String…
leo
  • 3,677
  • 7
  • 34
  • 46
13
votes
1 answer

How to disable default scoring/boosting in Hibernate Search/Lucene?

I want to serve my users the most relevant and best results. For example, I'm rewarding records that have a big title, description, attached photos, etc. For context: the records are bicycle routes, having routepoints (coordinates) and metadata like…
Thermometer
  • 2,567
  • 3
  • 20
  • 41
13
votes
1 answer

Hibernate warning about follow-on locking using Oracle 10g

I am using Hibernate 4.3.0.Final / JPA 2.1, Hibernate Search 4.5.0.Final running on WildFly 8.0.0.Final. My application works absolutely fine, but I am getting this hibernate warning when the indexes are being created. WARN…
humungs
  • 1,144
  • 4
  • 25
  • 44
13
votes
4 answers

Why use Elasticsearch or Apache Solr along with Hibernate Search?

I learned and understood that Elasticsearch, Apache Solr and Hibernate Search are based on the Apache Lucene library. They provide fast full-text search and all of them either use JPA annotations, implement the JPA and/or define custom annotations.…
Steven
  • 1,218
  • 3
  • 18
  • 38
11
votes
3 answers

Autocomplete using Hibernate Search

I am trying to build a better autocomplete feature for my website. I want to use Hibernate Search for this but as far as I experimented it only finds full words for me. So, my question: is it possible to search for some characters only ? eg. user…
Rem Ma
  • 145
  • 1
  • 7
10
votes
6 answers

Hibernate Search, Lucene or any other alternative?

I have a query which is doing ILIKE on some 11 string or text fields of table which is not big (500 000), but for ILIKE obviously too big, search query takes round 20 seconds. Database is postgres 8.4 I need to implement this search to be much…
Julia
  • 1,217
  • 8
  • 23
  • 46
10
votes
1 answer

How to implement full text search in Spring Boot with JPA + MySQL

public class Product { private Long id; private String name; private String description; } Is there any way to implement a full text search with JpaRepository for the description of the class Product ?
10
votes
2 answers

java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

I am getting this error: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z These are the jars in my…
Panayiotis Karabassis
  • 2,278
  • 3
  • 25
  • 40
9
votes
3 answers

Getting error on a specific query

Novice on Lucene here. I'm using it with Hibernate in a java client, and have been getting this error on a particular query: HSEARCH000146: The query string 'a' applied on field 'name' has no meaningfull tokens to be matched. Validate the query…
ftkg
  • 1,652
  • 4
  • 21
  • 33
8
votes
1 answer

How to get around "connection reset by peer" when using Elasticsearch's RestClient

We are using Hibernate Search 5.10.3.Final against Elasticsearch 5.6.6 server. The connection between our app and ES seems solid when issuing FullTextQueries directly, maybe b/c HibernateSearch has some built in retry method, I'm not sure, however,…
Rick Gagne
  • 152
  • 1
  • 1
  • 10
8
votes
1 answer

Configuring Hibernate Search with Infinispan and Wildfly

I'm configuring Hibernate Search 5.5.5 to use Infinispan 8.2.2 on Wildfly 10. I configured only the Infinispan module in Wildfly, not the Hibernate Search module. Inside the persistence.xml I put this configuration:
Davide Cerbo
  • 363
  • 3
  • 10
8
votes
1 answer

Hibernate Search sorting

Hibernate search is sorting results depending on relevance, it is normal. In addition to that, if two documents are having the same score, they are ordered by their primary keys. For example, book1 : id=1, bookTitle = "hibernate search by…
Bilal BBB
  • 1,154
  • 13
  • 20
8
votes
4 answers

How do I use boolean operators with Hibernate Search

I'm learning the Hibernate Search Query DSL, and I'm not sure how to construct queries using boolean arguments such as AND or OR. For example, let's say that I want to return all person records that have a firstName value of "bill" or "bob".…
NobodyMan
  • 2,381
  • 4
  • 29
  • 35
1
2 3
97 98