<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><br><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>From: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:chase.seibert+opensubscriber@gmail.com">chase.seibert+opensubscriber@gmail.com</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>Date:<span class="Apple-converted-space"> </span></b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"> June 3, 2009 09:21:21<span class="Apple-converted-space"> </span>PDT</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>To: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>Subject: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><b>Re: Re: [hibernate-dev] HSearch: Using sharding and avoiding query on multiple shards</b></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>Reply-To: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:chase.seibert+opensubscriber@gmail.com">chase.seibert+opensubscriber@gmail.com</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> </div><div>Emmanuel,<br><br>Regarding HSEARCH-251, and <a href="http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/9770383.html">http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/9770383.html</a><br><br>Being able to query just a single shard or subset of shards would be awesome. I was thinking of a similar API:<br><br>IndexShardingStrategy:<br>public DirectoryProvider<?>[]<br>getDirectoryProviderForShard(int shardNum);<br><br>FullTextQuery:<br>public void enableShardFilter(int shardNum);<br>public void enableShardFilters(int[] shardNums);<br><br>FullTextQuery.buildSearcher() would need to be modified to call getDirectoryProviderForShard() for each shardNum if shardNums are set, otherwise it should continue to use getDirectoryProvidersForAllShards();<br><br>Calling this API from a consumer's stand-point would look like:<br>FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(luceneQuery, entityClass);<br>fullTextQuery.enableShardFilter(5);<br>fullTextQuery.list();<br><br>This could be changed to pass named shards easily. I could prototype this and submit a .patch if you are interested.<br><br> -Chase<br><br>--<br>This message was sent on behalf of <a href="mailto:chase.seibert+opensubscriber@gmail.com">chase.seibert+opensubscriber@gmail.com</a> at openSubscriber.com<br><a href="http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/9800518.html">http://www.opensubscriber.com/message/hibernate-dev@lists.jboss.org/9800518.html</a><br></div></blockquote></div><br></body></html>