From: chase.seibert+opensubscriber(a)gmail.com
Date: June 3, 2009 09:21:21 PDT
To: emmanuel(a)hibernate.org
Subject: Re: Re: [hibernate-dev] HSearch: Using sharding and
avoiding query on multiple shards
Reply-To: chase.seibert+opensubscriber(a)gmail.com
Emmanuel,
Regarding HSEARCH-251, and
http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/97703...
Being able to query just a single shard or subset of shards would be
awesome. I was thinking of a similar API:
IndexShardingStrategy:
public DirectoryProvider<?>[]
getDirectoryProviderForShard(int shardNum);
FullTextQuery:
public void enableShardFilter(int shardNum);
public void enableShardFilters(int[] shardNums);
FullTextQuery.buildSearcher() would need to be modified to call
getDirectoryProviderForShard() for each shardNum if shardNums are
set, otherwise it should continue to use
getDirectoryProvidersForAllShards();
Calling this API from a consumer's stand-point would look like:
FullTextQuery fullTextQuery =
fullTextSession.createFullTextQuery(luceneQuery, entityClass);
fullTextQuery.enableShardFilter(5);
fullTextQuery.list();
This could be changed to pass named shards easily. I could prototype
this and submit a .patch if you are interested.
-Chase
--
This message was sent on behalf of chase.seibert+opensubscriber(a)gmail.com
at
openSubscriber.com
http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/98005...