Fwd: [hibernate-dev] HSearch: Using sharding and avoiding query on multiple shards

Emmanuel Bernard emmanuel at hibernate.org
Wed Jun 3 12:28:12 EDT 2009



Begin forwarded message:

> From: chase.seibert+opensubscriber at gmail.com
> Date:  June 3, 2009 09:21:21  PDT
> To: emmanuel at hibernate.org
> Subject: Re: Re: [hibernate-dev] HSearch: Using sharding and  
> avoiding query on multiple shards
> Reply-To: chase.seibert+opensubscriber at gmail.com
>
> Emmanuel,
>
> Regarding HSEARCH-251, and http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/9770383.html
>
> 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 at gmail.com 
>  at openSubscriber.com
> http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/9800518.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-dev/attachments/20090603/5d75044f/attachment.html 


More information about the hibernate-dev mailing list