-->
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: Configuration of Index-Shards problem
PostPosted: Tue Apr 01, 2008 4:36 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi all,
I was writing some extensive unit tests for H.Search configuration parsing when I discovered the following behavior:

I have a SearchTestCase with the following configuration:

Code:
cfg.setProperty( "hibernate.search.Documents.sharding_strategy.nbr_of_shards", "3" );

In this case I get
Code:
searchFactory.getDirectoryProviders(Document.class).length==3

and that's Ok.
Now I add some more options:
Code:
cfg.setProperty( "hibernate.search.Documents.sharding_strategy.nbr_of_shards", "3" );
cfg.setProperty( "hibernate.search.Documents.0.batch.max_merge_docs", "57" );
cfg.setProperty( "hibernate.search.Documents.0.transaction.max_buffered_docs", "58" );
cfg.setProperty( "hibernate.search.Documents.1.batch.max_merge_docs", "57" );
cfg.setProperty( "hibernate.search.Documents.1.transaction.max_buffered_docs", "58" );
cfg.setProperty( "hibernate.search.Documents.2.batch.max_merge_docs", "57" );
cfg.setProperty( "hibernate.search.Documents.2.transaction.max_buffered_docs", "58" );

And I still get 3 DirectoryProviders as expected; If I rewrite the configuration to the following, expecting it as equivalent of the previous one:
Code:
cfg.setProperty( "hibernate.search.Documents.batch.max_merge_docs", "57" );
cfg.setProperty( "hibernate.search.Documents.transaction.max_buffered_docs", "58" );
cfg.setProperty( "hibernate.search.Documents.sharding_strategy.nbr_of_shards", "3" );
It still returns 4 Dir.Providers.
Now adding more options actually make the number of directoryproviders larger!
Ex.:
Code:
cfg.setProperty( "hibernate.search.Documents.batch.merge_factor", "9" );
cfg.setProperty( "hibernate.search.Documents.batch.max_buffered_docs", "9" );
cfg.setProperty( "hibernate.search.Documents.batch.max_merge_docs", "57" );
cfg.setProperty( "hibernate.search.Documents.transaction.max_buffered_docs", "58" );
cfg.setProperty( "hibernate.search.Documents.sharding_strategy.nbr_of_shards", "3" );
This results in
Code:
searchFactory.getDirectoryProviders(Document.class).length==5
which is obviously wrong.

So.. I suppose it is a bug and would open a JIRA for it, but I'm not shure if the "shorthand" configuration I was trying to set was meant to be supported; If not I think an error should be thrown.

I volunteer to fix it myself, but would appreciate some feedback about the intended behavior.

Sanne


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 6:12 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Looks like an nice bug to me :)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 9:37 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello Emmanuel, nice to see you are finding some time to catch up with the forum.
I have provided a patch for this in HSEARCH-176;
I could split this in two if you prefer (to separate it from the new feature)
but the new one requires the bugfix.

Sanne


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.