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

java.lang.ClassCastException: ... Lucene40PostingsFormat

I'm trying to use Hibernate-Search in one of my JavaEE projects and seem to run into the exact same problem as described by Rallenaldo: My Maven-project is using Java JDK 1.8.0_73 Hibernate 5.0.6.Final Hibernate-Search 5.5.2.Final (which uses…
3
votes
0 answers

Hibernate Search - Setting Facets via a Field Bridge

In Hibernate Search 5.3 the @Facet annotation was introduced and must be used to store a field as a Facet. What I'm wondering is if their is a way to add a field as a facet in a custom field bridge, without using the @Facet annotation. My use case…
mharray
  • 79
  • 8
3
votes
1 answer

Hibernate full text search custom order by

We want to add custom order by to hibernate full text search,suppose we want to search the record based on location, if the location is "country,state,city Then we want to have the search with records in the top which are near to user We followed…
3
votes
1 answer

Hibernate Search is very slow for one query, fast for another

I have a problem and I've been struggling for several days now. I just don't understand why Hibernate Search works fast enough for one query, but slow for another. I've read a lot of related posts on stackoverflow, hibernate search documentation,…
0x42
  • 165
  • 1
  • 7
3
votes
1 answer

Hibernate-Search @IndexedEmbedded with HashMap, how to include keyset in index

I'm trying to integrate Hibernate Search into an application. The application entities can have multiple properties that are stored multilingual. This is accomplished by splitting the non multilingual and multilingual properties into seperate…
René Kamp
  • 139
  • 3
3
votes
4 answers

How to not transform special characters to html entities with owasp antisamy

I use Owasp Anti samy with Ebay policy file to prevent XSS attacks on my website. I also use Hibernate search to index my objects. When I use this code: String html = "special word: été"; // use the Ebay configuration file Policy policy =…
Jerome Cance
  • 8,103
  • 12
  • 53
  • 106
3
votes
2 answers

Spring MVC code- Throws HSEARCH000103 exception when it is being deployed

In our springmvc website, we are using hibernate search with lucene. There are no issues when i compile the code, but when i try to deploy the code on a tomcat 7.0.52 running on Ubuntu 14.04 64bit server, i get the following exceptions INFO:…
jsooner
  • 31
  • 1
  • 4
3
votes
1 answer

Query an IndexedEmbedded list of Enumerated (enum) with Hibernate Search

I have the model below and I'm trying to use Hibernate Search for full text search. I need to search into the "about" field for all the users with the UserRole.PROFESSIONIST role. This is the model: @Entity @Indexed public class User { @Id …
Francesco Papagno
  • 617
  • 10
  • 29
3
votes
2 answers

Is it possible to use a numeric encoding for @Id fields with Hibernate Search 5.X

Before upgrading to Hibernate Search 5 from version 4.5, our system indexed all document ID's as numeric fields: @Entity public class Staff { @Id @NumericField protected Long id; // other fields } This allowed us to use numeric…
Kevin
  • 4,070
  • 4
  • 45
  • 67
3
votes
0 answers

Hibernate Search not working for many to many relationship

I have two entities Restaurant and Category, related by a many-to-many relation. I want to search a restaurant by category_name but i am not able to get correct results for my search, even though I can see that list is being populated correctly with…
Android Mason
  • 459
  • 1
  • 6
  • 17
3
votes
1 answer

How to search with multiple parameters in Hibernate Search 3.0.0.ga

Using: Hibernate 3.2.7.ga Hibernate-Search 3.0.0.ga Hibernate-Anotations 3.3.0.ga Hibernate-Commons-Cnnotations 3.0.0.ga Lucene-Core 2.9.4 Lucene-Analyzers 2.9.4 Lucene-Queryparser 2.9.4 How can search with multiple parameters like: SELECT * FROM…
Jonatan H.
  • 57
  • 1
  • 1
  • 9
3
votes
1 answer

Hibernate Search FullTextQuery getResultSize never matches getResultList().size()

Does anyone have a clue why Hibernate Search FullTextQuery (FullTextEntityManager) getResultSize() never matches the getResultList().size()? I am not passing anything to setFirstResult or setMaxResult. For example, I do a query on one field for…
chrislhardin
  • 1,747
  • 1
  • 28
  • 44
3
votes
1 answer

Hibernate search / lucene search in multiple fields child collections

I am using Hibernate Search in my application. One of child collections is mapped as IndexedEmbedded. Child object have two fields, one id and other is date (using date resoultion to milliseconds). When I search for id=1 (or some value) and date…
gmansoor
  • 509
  • 1
  • 4
  • 12
3
votes
2 answers

Reverse search in Hibernate Search

I'm using Hibernate Search (which uses Lucene) for searching some Data I have indexed in a directory. It works fine but I need to do a reverse search. By reverse search I mean that I have a list of queries stored in my database I need to check…
Javi
  • 19,387
  • 30
  • 102
  • 135
3
votes
1 answer

Solr vs HibernateSpatial vs HibernateSearch

In my web app (built using Spring/Hibernate v4 + JPA v2.1 + PostgreSql 9.3), I have to provide the below functionalities: Text search from multiple database tables having few 10000's of rows Text search from files - doc, xls, pdf, htm (few…
AAgg
  • 494
  • 1
  • 3
  • 19