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

Hibernate Search / Lucene - Search for and rank unrelated entities with a single query

I have a full-text search working with hibernate search and lucene, in that I can successfully search for a given model entity across specific fields. However, rather than search for one type of entity at a time, I want to implement a 'universal'…
davnicwil
  • 28,487
  • 16
  • 107
  • 123
2
votes
1 answer

Lucene: find all words that start with specific prefix

I want to get a list of all words in a Lucene index that start with a specific prefix. I've been looking for a way to query the terms in the index (I need the terms, I don't care about the documents they are from) but without success. Any ideas?
Giuseppe
  • 347
  • 2
  • 11
2
votes
1 answer

Hibernate search: spatial+less than condition

I want to add some criteria to hibernate search spatial query. I have a class Store which has latitude and longitude. Also it has a price attribute. I want to find all the stores around a particular location with price point less than given input.…
rishi
  • 2,564
  • 6
  • 25
  • 47
2
votes
1 answer

How to get search hits based on one of the attributes in embedded id in hibernate search?

I have following hibernate search entity class: @Entity @Indexed public class TableA { @EmbeddedId @DocumentId @FieldBridge(impl = TableA_Bridge.class) @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO) private…
rose1
  • 73
  • 7
2
votes
0 answers

Custom Lucene Sharding with Hibernate Search

Has anyone experience with custom Lucene sharding / paritioning using Hibernate Search? The documentation of Hibernate Search says the following about Lucene Sharding : In some cases, it is necessary to split (shard) the indexing data of a …
Timo Westkämper
  • 21,824
  • 5
  • 78
  • 111
2
votes
1 answer

Hibernate Search With MultiTenancy

My requirement Is to each index per tenant , I do already have hibernate configured as MultiTenant , I need to index the database per tenant to different Index. I have seen to dynamicSharding Strategy.. But requirement is dynamic. it can have n…
Satyam Soni
  • 103
  • 1
  • 7
2
votes
1 answer

Hibernate search spatial embedded index query

I have two classes. User and Address. User: @Indexed @Entity @Table(name = "USERS") public class USER { @DocumentId @Id @Column(name = "ID") @GeneratedValue(strategy = GenerationType.TABLE,…
rishi
  • 2,564
  • 6
  • 25
  • 47
2
votes
1 answer

How to map lucene documentid to Hibernate search entity field

I have an entity with documentid @Indexed @Analyzer(impl = EnglishAnalyzer.class) @Entity @Table(name = "Tag", schema = "cpsc") public class Tag extends BaseObject { public static final String NAME_FIELD = "name"; @Id @GeneratedValue(strategy =…
2
votes
2 answers

Hibernate-Search hanging with many (90) entity classes.

I am using hibernate search for my application. It is well configured and running perfectly till some time back, when it stopped working suddenly. The reason according to me being the number of my model (bean) classes. I have some 90 classes, which…
KCore
  • 275
  • 1
  • 4
  • 13
2
votes
1 answer

Lucene frontend / GUI

I am using hibernate-core and hibernate-search. Like I can take a look to the persisted entities with hibernate-core using some database-frontend, I need a frontend for hibernate-search/lucene to take a look at the lucene index. I tried the latest…
Emi
  • 249
  • 2
  • 9
2
votes
1 answer

Enable hibernate search in wildfly

I need use the hibernate search 4.5 in my EJB project, I deploying the project in Wildfly 8.0. but the import sentence not work. somebody can tell me how to enable the hibernate search in wildfly?
Jericob
  • 1,947
  • 2
  • 14
  • 16
2
votes
2 answers

How to use analyzer in Hibernate Search?

When I use Infinispan with Hibernate, I need to use Analyzer to find results which includes the key word. But when I search the keyword SNO_NO_D6-11100 with query like: QueryBuilder queryBuilder = CSECore.searchManager …
Stephan
  • 207
  • 1
  • 10
2
votes
1 answer

org.hibernate.search.bridge.BridgeException: Exception while calling bridge#objectToString

I am able to insert record and able index them but i am facing an exception while searching org.hibernate.search.bridge.BridgeException: Exception while calling bridge#objectToString class:…
G SriHAri
  • 706
  • 2
  • 9
  • 27
2
votes
1 answer

Why hibernate search deletes the index directories (master/slave config)

I don't want to rebuild the indexes everytime my application starts but master directory provider (FSMasterDirectoryProvider line# 124/125) deletes the index files when it bootstraps. Any idea how i can skip that so i can reuse the existing indexes…
Jayesh
  • 983
  • 6
  • 16
2
votes
1 answer

Tuning Lucene indexing performance in infinispan

I'm using hibernate search and lucene index in infinispan. But the time for indexing is too long. I'm trying to optimize the performance of indexing with tuning options. I.e, set hibernate.search.​[default|].​indexwriter.ram_buffer_size…
Stephan
  • 207
  • 1
  • 10