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

Hibernate Search field mapping

The Hibernate Search @Field annotation gives the option to choose index name for a property: ... @Field(name="somethingOrOther") public String getSomeValue() { ... The user guide says this about the name property of the @Field annotation: name :…
Nils Weinander
  • 2,081
  • 2
  • 15
  • 20
3
votes
1 answer

Replication Timeouts in Infinispan

I'm working with a 10-node Infinispan cluster used as a Hibernate Search backend. Our servers are running TC server 2.5 (tomcat 6.0.32) on Java 1.6_24. We are using jGroups 2.12.1.3 for handling cluster cache writes from each node, and for…
Peter Bratton
  • 6,302
  • 6
  • 39
  • 61
3
votes
2 answers

How to work around the hibernate search (lucene) criteria restriction plus getResultSize issue?

Hibernate search (lucene) has an issue: If you apply a criteria restriction to FullTextQuery and apply pagination restrictions, i.e. criteria.setMaxResults() and criteria.setFirstResult(), the fullTextQuery.getResultSize() returns a count which…
jaseFace
  • 1,415
  • 5
  • 22
  • 34
3
votes
1 answer

Hibernate search storing byte[] in index

I have following config in my POJO: @Field(index = Index.NO, store = Store.YES) private byte[] file; When I start my Apps container I get following exception: Caused by: org.hibernate.search.SearchException: Unable to guess FieldBridge for file …
MatBanik
  • 26,356
  • 39
  • 116
  • 178
3
votes
1 answer

Lucene Analyzer for Indexing and Searching

I have a field that I am indexing with Lucene like so: @Field(name="hungerState", index=Index.TOKENIZED, store=Store.YES) public HungerState getHungerState() { The possible values of this field are HUNGRY, SLIGHTLY_HUNGRY, and NOT_HUNGRY When these…
schmimd04
  • 1,444
  • 3
  • 14
  • 23
3
votes
1 answer

Hibernate Search 6 with Hibernate 6

I'm trying to setup Spring Boot 3.0.1 project from scratch using latest versions. So far I managed to get working mvc and repositories, but while adding Hibernate Search, things won't work anymore. Below you can see my pom.xml file. When I go to…
horvoje
  • 643
  • 6
  • 21
3
votes
1 answer

Creating and using LuceneAnalysisDefinitionProvider with Hibernate Search

When you search Stackoverflow or the Internet for LuceneAnalysisDefinitionProvider, you'll find hundreds of pages, each of them having the same code copied from another page without any decent explanation or further examples of usage. So I tried to…
horvoje
  • 643
  • 6
  • 21
3
votes
1 answer

Selected facet should not filter own group using hibernate search

If I have some Products with color and size. Jeans Blue Size L Jeans Red Size S T-shirt REd Size S and so on.. Doing a facet search using hibernate-search works as quite well. But if I select one of the criteria, I would expect that the values of…
3
votes
2 answers

Hibernate Search not indexing embedded collections properly

I'm currently working on a project that involves the use of Hibernate Search. Currently the project uses pure SQL for its searches and we would like to use a text search instead (Needing to know and correctly spell the first word can get…
tunderwood
  • 91
  • 1
  • 5
3
votes
1 answer

Hibernate Search Filter not having expected results with Enum

I'm using hibernate search 3.4, and I'm running in to a small problem. I have a filter I'm attempting to use (CourseStatusFilterFactory), but every time I enable it, no results are returned. I have another filter that works without issues…
KevMo
  • 5,590
  • 13
  • 57
  • 70
3
votes
1 answer

DateBridge for ZonedDateTime in hibernate search gives exception while indexing the data

My entity has a ZonedDatetime field @Indexed @Entity public class Book { @Id private Long id; @Field @DateBridge(resolution = Resolution.SECOND) private ZonedDateTime createdAt; // Other fields and setters &…
3
votes
1 answer

Starts with a word or ends with a word using hibernate search

I am using Hibernate Search with spring-boot. I have requirement that user will have search operators to perform the following on the establishment name: Starts with a word .Ali --> Means the phrase should strictly start with Ali, which means…
Kamran Ullah
  • 101
  • 9
3
votes
1 answer

Asynchronously build Hibernate Search index to ensure no downtime.

We are using Hibernate Search (Lucene Engine) to enable fuzzy search for text some data we are storing in SQL Server database and consumed by a search service written in Java 8. The data source for the search is a table with moderate edit/update…
3
votes
2 answers

Using Hibernate Search to Rate Result

Is it possible for hibernate search to sort result according to best match after it has search result from the database
Noor
  • 19,638
  • 38
  • 136
  • 254
3
votes
2 answers

Hibernate Search: Fielddata is disabled on text fields

I attempted upgrade from Hibernate Search 5.8.0.CR1 to 5.8.2.Final and from ElasticSearch 2.4.2 to 5.6.4. When I run my application I'm getting the following error: Status: 400 Bad Request Error message:…
nuoritoveri
  • 2,494
  • 1
  • 24
  • 28