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

Hibernate Search and Relations

I have an object called MyItemBean which can have 0 or more associated KeywordBean objects. The resulting classes look like this: @Entity public class MyItemBean { ...stuff... @ManyToMany(targetEntity = KeywordBean.class, cascade =…
Shadowman
  • 11,150
  • 19
  • 100
  • 198
4
votes
1 answer

Hibernate Search..Access a Sealed WorkQueue which has not been sealed

I am trying to use Hibernate Search for a new project. We have Hibernate and Spring without JPA. I m getting the following exception when Hibernate Search tries to update the index file thru the event listeners. I have read around on this issue…
4
votes
1 answer

Use existing analyzer in hibernate search AnalyzerDiscriminator

@Entity @Indexed @AnalyzerDefs({ @AnalyzerDef(name = "en", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = LowerCaseFilterFactory.class), @TokenFilterDef(factory =…
user5177570
4
votes
1 answer

java.lang.NoClassDefFoundError: org/hibernate/service/ServiceRegistry

I am using hibernate-search 5.5.4.Final with hibernate-entitymanager 5.0.9 (matched with hibernate-core 5.0.9). But when i deployed the ejb maven module on glassfish 4.1. I obtained the following exception: Grave: java.lang.NoClassDefFoundError:…
4
votes
1 answer

Hibernate search with infinispan, How to store the index in a persistent cache store

Hibernate search default infinispan configuration store indexes in memory,you have to reindex everything once you shutdown application. I read infinispan document, there is a way to store index into a infinispan file store. After I do googling…
王子1986
  • 3,019
  • 4
  • 31
  • 43
4
votes
1 answer

Hibernate search , querying on associations

I am new to Hibernate search , can anyone suggest me how to query on Embedded entities (one to many) @Indexed @Entity public class EventDetails implements Serializable { @OneToMany( cascade = CascadeType.ALL ) @IndexedEmbedded …
Shreesha N
  • 892
  • 2
  • 8
  • 20
4
votes
1 answer

ClassCastException with Lucene

I´m working on a web application with Hibernate Search using Lucene. I updatetd this application to Hibernate 5.5.1 (former 4.3.5 (hibernate-core ) 4.3.10 (hibernate-entity-manager). I´ve created an lucene index (version 4.7) with the former…
4
votes
1 answer

Understanding Apache Lucene's scoring algorithm

I'm working with Hibernate Search for months now, but still I'm not able to digest the relevance it brings. I'm overall satisfied with the results it returns, but even simplest test does not satisfy my expectation. First test was using the term…
Tejas
  • 6,508
  • 1
  • 21
  • 25
4
votes
1 answer

Hibernate search - The SearchFactory was not initialized

I'm trying to use hibernate search. Following this guide http://hibernate.org/search/documentation/getting-started/ I've added this two lines to hibernate.cfg.xml
Andrea Catania
  • 1,361
  • 3
  • 21
  • 37
4
votes
3 answers

when changing hibernate index location (lucene) at runtime index is not getting stored on new location

I have requirement in my application where we need to store index on the bases of user so I am trying to change location at runtime, but index is not getting stored on new location and if I am giving same location in config file then it is getting…
user1047873
  • 230
  • 3
  • 8
  • 28
4
votes
1 answer

Hibernate search, possible to search special chars?

Is it possible to find by fullTextQuery exactly word with special chars? Search by luke working good with query, but from fullTextQuery returns no results. new…
kxyz
  • 802
  • 1
  • 9
  • 32
4
votes
1 answer

Apache Lucene and Hibernates search getting error

Exception in thread "main" java.lang.VerifyError: class org.hibernate.search.util.impl.DelegateNamedAnalyzer overrides final method tokenStream.(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream;
user2709752
  • 488
  • 6
  • 26
4
votes
1 answer

Hibernate Search tries to guess fieldbridges for unindexed entities

I'm trying to use Hibernate Search (4.4.0) in a project with a large object model (>200 entities). Of these, I want to index only a few entities; currently just a single one. I added the @Indexed, @DocumentId and @Field annotations as appropriate to…
Rubrick
  • 308
  • 5
  • 13
4
votes
3 answers

hibernate search + spring3 + jpa

I'm trying to integrate hibernate search in my project. My models are indexed, but for some reason my search queries do not return any results. I've been trying to solve this issue for a few hours now, but nothing I do seems to work. Domain…
Jeroen
  • 527
  • 2
  • 7
  • 19
4
votes
3 answers

Can you sort and search on same field with Hibernate/Lucene?

I have the following annotated class that I am trying to sort the results from a lucene/hibernate search query. I finally have the query working properly but it seems that when I implement the necessary annotations (seen on jobStatus) to sort that…
Adam James
  • 3,833
  • 6
  • 28
  • 47