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
7
votes
5 answers

How to best search against a DB with Lucene?

I am looking into mechanisms for better search capabilities against our database. It is currently a huge bottleneck (causing long-lasting queries that are hurting our database performance). My boss wanted me to look into Solr, but on closer…
Mike Stone
  • 44,224
  • 30
  • 113
  • 140
7
votes
3 answers

Hibernate Search, Entities, and SQL VIEWs

I have a table that maintains rows of products that are for sale (tbl_products) using PostgreSQL 9.1. There are also several other tables that maintain ratings on the items, comments, etc. We're using JPA/Hibernate for ORM in a Seam application,…
Shadowman
  • 11,150
  • 19
  • 100
  • 198
7
votes
1 answer

Hibernate Search in a Clustered Configuration?

I have a Java web app that I'm developing, using JBoss Seam as the application framework. I'd like to take advantage of Hibernate Search to provide entity searching capabilities. The integration has gone fine, and I'm getting closer to deployment.…
Shadowman
  • 11,150
  • 19
  • 100
  • 198
7
votes
1 answer

Hibernate Search vs spring-data-solr , spring-data-elasticsearch

I have a spring boot, Spring Data JPA (hibernate) web application and want to introduce text search feature. I understand the following Both hibernate search or spring-data-* can be integrated into my app Hibernate search can work with embedded…
7
votes
2 answers

Hibernate Search doesn't index/reindex entities

I'm trying to use Hibernate Search in my project (writing tests right now using junit + dbunit), but searching query doesn't return any results. I worked on this yesterday and got to conclusion that problem is Hibernate Search doesn't work well with…
Plebejusz
  • 3,332
  • 2
  • 19
  • 26
7
votes
2 answers

How to search fields with wildcard and spaces in Hibernate Search

I have a search box that performs a search on title field based on the given input, so the user has recommended all available titles starting with the text inserted.It is based on Lucene and Hibernate Search. It works fine until space is entered.…
zoran jeremic
  • 2,046
  • 4
  • 21
  • 47
7
votes
3 answers

Advanced Search Using Hibernate Search

In one of my applications, I am to execute a search on multiple fields/columns. Its an Advanced Search and there are over 20 fields using which a user can search for results. For example, a user can search for bookings based on Booking Id Passenger…
SB.
  • 1,887
  • 2
  • 19
  • 31
6
votes
0 answers

Hibernate Search QueryBuilder: query for non-entity field

I am trying to use the QueryBuilder from Hibernate Search with a field which is not a property of the respective Entity but rather constructed on the fly using an ClassBridge. Can I do that? QueryBuilder qb =…
KoW
  • 784
  • 5
  • 12
6
votes
1 answer

Hibernate Search Class Not Found Exception Lucene Field$TermVector

I am trying to integrate Hibernate Search into my Spring boot application and I keep getting the following error every time I try to use the @Indexed (org.hibernate.search.annotations.Indexed) annotation Caused by: java.lang.ClassNotFoundException:…
6
votes
2 answers

get the annotation information at runtime

I wonder if there is any way I can get the annotation information of a class at runtime? Since I want to get the properties that sepcifily annotated. Example: class TestMain { @Field( store = Store.NO) private String name; …
hguser
  • 35,079
  • 54
  • 159
  • 293
6
votes
2 answers

How to do case insensitive sorting of Norwegian characters (Æ, Ø, and Å) using Hibernate Lucene Search?

æ, ø, å are latest letters in the norwegian alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å When we try to sort it using Hibernate Lucene then Å clubs with A, Ø clubs with Ø, Æ clibs with A which is wrong. For example: Currrent…
fatherazrael
  • 5,511
  • 16
  • 71
  • 155
6
votes
2 answers

Turn off indexing in hibernate search

I have hibernate search set-up and it's (re-)indexing my annotated entities up on commit just fine. But I have a number of integration tests which have only partially initilzed data. Since this is throwing exceptions when hibernate search tries to…
BetaRide
  • 16,207
  • 29
  • 99
  • 177
6
votes
0 answers

Hibernate search, infinispan, jclouds and Amazon S3 - IllegalArgumentException: bucketId: A96137216.bz2 (expected: integer)

I'm trying to use Hibernate Search to use a Lucene Index hosted on Amazon S3 but I'm getting the following exception: Exception in thread "LuceneIndexesData-CloudCacheStore-0" java.lang.IllegalArgumentException: bucketId: A96137216.bz2 (expected:…
lance-java
  • 25,497
  • 4
  • 59
  • 101
6
votes
1 answer

How to remove all the duplicate results in Hibernate Search?

I'm using Infinispan with 6.0.2 with Hibernate Search 4.4.0. In the begining, after I execute a query like CacheQuery cq = SearchManager.getQuery(query,Hibernate.class).projection("id"); I use the cq.list() to get "id". But now the number of…
Stephan
  • 207
  • 1
  • 10
6
votes
1 answer

JGroups nodes on EC2 not talking although they see each other

I'm trying to use Hibernate Search so that all writes to the Lucene index from jgroupsSlave nodes are sent to the jgroupsMaster node, and then the Lucene index is shared back to the slaves with Infinispan. Everything works locally, but while the…
dustincg
  • 139
  • 9
1
2
3
97 98