FAQ Database Discussion Community


org.hibernate.HibernateException: Error while indexing in Hibernate Search (before transaction completion)

java,hibernate,hibernate-search
I'm receiving the following error while using session.clear() in my batch transaction with hibernate. org.hibernate.HibernateException: Error while indexing in Hibernate Search (before transaction completion) I'm using the following code try { for (TimeSheetEntity timeSheet : timeSheets) { timeSheet.setActive(false); try { session.update(timeSheet); count++; if (count % 250 == 0 || totalCount...

Hibernate Search not indexing items from database

java,spring,hibernate,lucene,hibernate-search
I'm trying to integrate Hibernate Search in my application. Rough summary of what needs to be done: Spring Batch reads out an XML file and persists the objects to database. This is done with de JDBCBatchItemWriter. Not the HibernateItemWriter because of slow performance. After all items are inserted I would...

Can Hibernate Search index build performance be improved using projection?

java,hibernate,hibernate-search
I have an entity containing around 40 columns and 7 collections. The collections are not lazy loaded. Indexing 500 000 entities using Hibernate Search MassIndexer takes around 2-3 hours. I use the code below: fullTextSession.createIndexer() .batchSizeToLoadObjects(1000) .threadsToLoadObjects(8).start(); I even tried using lazy loading to see what the difference would be,...

LIE on commit from Hibernate Search

java,spring,hibernate,hibernate-search
We're adding Hibernate Search 3.4 to our existing web application (using Hibernate 3.6 and Spring 3.2.3). With the default <prop key="hibernate.search.lucene_version">LUCENE_31</prop> <prop key="hibernate.search.default.directory_provider">filesystem</prop> <prop key="hibernate.search.default.indexBase">C:\scratch\lucene</prop> <prop key="hibernate.search.Rules.directory_provider">ram</prop> <prop key="hibernate.search.indexing_strategy">event</prop> we're getting...

Access Directory in Hibernate Search 5

hibernate,hibernate-search
I still work with Bobo because of the limited faceting option in HSearch. Because of this I need to supply Bobo with a DirectoryReader for it to work. Now I'm trying to upgrade to Hibernate Search 5 and my old way of getting that doesn't work anymore. MutableSearchFactory factory =...

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

java,lucene,hibernate-search
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 example WHERE column1 = "text1" AND (column2 = "text2" OR column2 ="text3") With Hibernate-Search documentation I only found that example of searching: Session session =...

Hibernate Search Faceting not working

java,hibernate,jpa,hibernate-search
I´m programming a web application with Java EE, Hibernate Search, JPA and JSF. I have been reading the hibernate Search documantation over and over again, but I just can´t get faceting to work properly. I have a database which includes several categorys. I made an example with football clubs. I...

How to Integrate Spring 4 with Hibernate Search 5?

spring,hibernate,hibernate-search
I have already integrate Spring MVC+ Spring Framework 4 + Hibernate ORM 4. Now I want to use full text search in hibernate search. So, How to Integrate Spring Framework 4 with Hibernate Search 5? ...

Get results with exact match

lucene,hibernate-search
I want to do a query like that : "banana apple cherry" on a "fruit" field. All the fruits in the desserts needs to be in the query, but not all the fruits in the query needs to be in the desserts.. Here's an example.. NAME        ...

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

java,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 TableA_Pk id; /* Other fields; setters and getters; */ } Following is the TableA_Pk class: @Embeddable public class TableA_Pk implements Serializable {...

Hibernate Search 5.0 Numeric Lucene Query HSEARCH000233 issue

hibernate-search
Issue: how do we provide hibernate search with a raw lucene query string that includes numeric and non-numeric fields? Background: we recently upgraded to HibernateSearch 5.0 and many of our queries are now failing because of a change in the HibernateSearch Query Parser (pre-lucene) with the following error: The specified...

Is it possible to select dynamically a field to use in hibernate search

java,hibernate,lucene,hibernate-search
I have something like this : class A : @Entity @Indexed public class A { @Fields({ @Field(name="a"....) @Field(name="b"....) )} private String someField; .... } } And class B: @Entity @Indexed public class B { @IndexedEmbedded @ManyToOne private A a; ...... } I would like to use @Field 'a' when indexing...

Understanding Apache Lucene's scoring algorithm

search,solr,lucene,full-text-search,hibernate-search
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 frequency(tf). Data: word word word word word word...

HornetQ using JNDI / remoting when used with WildFly 8.1 cluster

cluster-computing,jndi,wildfly,hibernate-search,hornetq
Previously 2 JBoss 6 servers (master & slave) were started with 2 different IP addresses (127.0.0.1 and 127.0.0.2) and those 2 server instances were run in domain mode. The instances used HornetQ to communicate index jobs for Hibernate Search. I'm trying to create a similar configuration using Wildfly instead of...

Hibernate Search (Lucene) filter on collections

lucene,hibernate-search
I have a problem to implement a boolean logic with Hibernate Search Filter. There are persons that can be part of groups. Every group has a status from status catalog. I need to filter all the users that are in group 1 and have status 2. For that I'm using...

Hibernate Search sorting

hibernate,lucene,hibernate-search
Hibernate search is sorting results depending on relevance, it is normal. In addition to that, if two documents are having the same score, they are ordered by their primary keys. For example, book1 : id=1, bookTitle = "hibernate search by example". book2 : id=2, bookTitle = "hibernate search in action"...

Hibernate Search doesn't reindex lucene index after insert

java,spring,hibernate,jpa,hibernate-search
I'm using Hibernate (with JPA) and Hibernate Search for my Spring web application. When the application starts on the server, I create the Indexes with the following code: EntityManager em = emf.createEntityManager(); FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(em); fullTextEntityManager.createIndexer().startAndWait(); em.close(); That works like a charm. However, when I insert new entities through...

polymorphic queries in hibernate search

java,hibernate,hibernate-search
I try to simplify my question, I have class A : @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class A { @Field private String a; .... } and class B which extends class A: @Entity @Indexed public class B extends A { @Field private String b; .... } another class C which...

Hibernate Search integrated into Play Framework (JPA)

java,hibernate,jpa,hibernate-search,hibernate-entitymanager
Im am trying to use Hibernate Search together with Play Framework. It seams very easy and straight forward. But I get a exception (see below): Here is what I did: I added dependencies "org.hibernate" % "hibernate-entitymanager" % "4.3.8.Final", "org.hibernate" % "hibernate-search-orm" % "5.2.0.Final", I already had Entitymanager and it works...