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

When to use Lucene/Hibernate Search

I am working on an application where we have different types of Searches.Some of them are full text searches over multiple columns in a MYSQL database and i am using Hibernate Search(which uses lucene internally ) for these. Now my question is What…
Abhishek Ranjan
  • 911
  • 1
  • 14
  • 29
3
votes
2 answers

QueryDSL and Hibernate Search isNull and isNotNull queries

I have a project in which I'm planning to use querydsl with hibernate search. However I have a constraint which blocks and I'm not sure how to implement. I have a oneToMany relationship between 2 classes shown here below (I'm omitting all the non…
ufasoli
  • 1,038
  • 2
  • 19
  • 41
3
votes
1 answer

Hibernate Search Indexing a single tenant

The database I am working on has a multi-tenant design. I want to implement hibernate search on my application however I want hibernate search to index a certain tenant only. How do I achieve that?
KyelJmD
  • 4,682
  • 9
  • 54
  • 77
3
votes
1 answer

Suggesting tags in a Java / MySQL / Hibernate Search / Lucene environment

I am working on a web-based application that allows our users to post typical blog / microblog / forum type posts and the one problem that we have had is that our users are not tagging their content very often. Since tags are very important in our…
brent777
  • 3,369
  • 1
  • 26
  • 35
3
votes
1 answer

Hibernate Search Paging + FullTextSearch + Criteria

I am trying to do a search with some criteria FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(finalQuery, KnowledgeBaseSolution.class).setCriteriaQuery(criteria); and then page it //Gives me around 700…
Roy Chan
  • 2,888
  • 6
  • 36
  • 43
3
votes
1 answer

Projection of Collections in lucene query in hibernate search

I am trying to use @IndexEmbedded annotation for indexing. The results are correct when i check using Luke.( i am getting all the elements of List). But when i tried to use this list in projection in Lucene Query, i am getting null. I read somewhere…
sudhir
  • 147
  • 1
  • 3
  • 12
3
votes
1 answer

Create separate hibernate search indexes for each subclass

I just started playing around with hibernate search. How can I solve the following problem. All my java entities where inherited from a superclass: @SuppressWarnings("rawtypes") @MappedSuperclass @Indexed public abstract class BaseEntity{ …
LStrike
  • 1,598
  • 4
  • 26
  • 58
3
votes
2 answers

Hibernate search 4.5 Alpha 1 Unable to guess FieldBridge for id in java.lang.Byte

I have a problem on deploying an EAR project to Wildfly 8 beta1. The project uses Hibernate Search 4.5 Alpha 1. There are indexed some entities. The project builds fine but when it is deployed an exception is thrown: Unable to guess FieldBridge for…
Tvori
  • 298
  • 8
  • 19
3
votes
1 answer

How to use hibernate lucene search for entity which have many to one relation

I am using Hibernate lucene for searching. Now I want to search with an entity which has a many to one relation I have two class one is catalogueBase and another one is Subject, here subject has a many-to-one relation (it is one sided relation)…
Rajesh Hatwar
  • 1,843
  • 6
  • 39
  • 58
3
votes
2 answers

Hibernate search - '%like%' type query

I'm using hibernate-search in my Spring MVC project and I would like to accomplish something but I'm not sure if it's possible. Here is the problem: I'm using NGramFilterFactoryClass for this and have configured minGramSize=3 and maxGramSize=3.…
DI_SO
  • 843
  • 4
  • 13
  • 29
3
votes
3 answers

Join hibernate search query with criteria query restriction

I'm wondering how you would join the following two queries together. A standard criteria query Criteria result1 = session.createCriteria(Store.class).add(Restrictions.eq("department.name", category)); and a FullTextSearch QueryBuilder…
Code Junkie
  • 7,602
  • 26
  • 79
  • 141
3
votes
1 answer

Unable to query Infinispan on JBoss 7 due to SearchFactoryIntegrator not being in the registry

TL:DR I'm getting the following error and I can see no reason for it, indexing is enabled, and the SearchFactoryIntegrator is on the classpath for everything that needs to see it. Indexing was not enabled on this cache. interface …
Kevin D
  • 3,564
  • 1
  • 21
  • 38
3
votes
3 answers

Hibernate Search behaves differently between DEV and PROD with same databse

I have one domain object that needs to be indexed by Hibernate Search. When I do a FullTextQuery on this object on my DEV machine, I get the expected results. I then deploy the app to a WAR and explode it to my PROD server (a VPS). When I perform…
Trevor
  • 1,137
  • 1
  • 19
  • 33
3
votes
2 answers

combine queries in hibernate search

is there a possibility in Hibernate Search (lucene) to combine two different queries. For example when I want to search with 2 fields that should have one corresponding matching value: firstname - John lastname -…
adaniluk
  • 321
  • 1
  • 5
  • 18
3
votes
1 answer

How does Hibernate Search handle annotations inherited from a superclass?

I'm having trouble creating a proper index structure with these entities: Person @Entity public class Person implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @OneToMany(mappedBy =…
mabi
  • 5,279
  • 2
  • 43
  • 78