-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Search targeted batch delete performance issue.
PostPosted: Wed Oct 10, 2012 10:55 am 
Newbie

Joined: Tue Sep 28, 2010 9:20 am
Posts: 6
Hi all,

I'm looking for a way to efficiently purge a subset of entities from the index.
Here is my entity class:

Code:
@Entity
@Table(name = "CONVERSION_ERROR")
@Indexed(index = "ConversionError")
public class ConversionError extends SimpleVersionedObject {

   /**
    *
    */
   private static final long serialVersionUID = 1L;

   @Field(analyze = Analyze.NO, store = Store.YES)
   private final Long viewId;

   @Field(analyze = Analyze.NO)
   private final Long attributeId;

   @Column(nullable = true)
   @Fields({ @Field(analyze = Analyze.NO, store = Store.YES),
         @Field(name = "value_forSearch", analyze = Analyze.YES, store = Store.YES) })
   private final String value;

   @Field(analyze = Analyze.NO)
   @org.hibernate.annotations.Index(name = "CONV_ERROR_SYS_IDX")
   private final Long systemId;

   @Field(analyze = Analyze.NO)
   @org.hibernate.annotations.Index(name = "CONV_ERROR_ATT_DEF_IDX")
   private final Long attributeDefinitionId;

   @Field(analyze = Analyze.NO)
   @org.hibernate.annotations.Index(name = "CONV_ERROR_MAP_DEF_ID")
   private final Long mappingDefinitionId;

        ....


My table contains around 1M entries. I want to be able to delete all the ConversionError objects that have the property mappingDefinitionId set to a specific value.
My understanding as of today is that the only two options available to me at the FullTextEntityManager level (I use JPA) are:

public <T> void purgeAll(Class<T> entityType);

and

public <T> void purge(Class<T> entityType, Serializable id);


Obviously purgeAll is not what I want. However, calling purge on 500k objects yield disastrous performance as 500k units of work are going to be executed.

Is there any other way to instruct hibernate search to purge the objects resulting for a term query?

Thanks for your feedback.


Top
 Profile  
 
 Post subject: Re: Hibernate Search targeted batch delete performance issue.
PostPosted: Wed Oct 10, 2012 6:37 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
no there is not, this is a new use case which we didn't predict being useful.

It's not too hard to provide a proper and efficient way to do this, can you please open a feature request on JIRA?

https://hibernate.onjira.com/browse/HSEARCH

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search targeted batch delete performance issue.
PostPosted: Thu Oct 11, 2012 2:56 pm 
Newbie

Joined: Tue Sep 28, 2010 9:20 am
Posts: 6
Hi Sanne,

Thanks for your prompt reply. I opened the following feature request:

https://hibernate.onjira.com/browse/HSEARCH-1205

Best,
Julien.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.