<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 27 Aug 2009, at 16:10, Emmanuel Bernard wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div><div></div><blockquote type="cite"><div><span class="Apple-style-span" style="font-family: Arial; ">queryBuilder.withAnalyzer(Analyzer)</span></div><div><span class="Apple-style-span" style="font-family: Arial; "><div>queryBuilder.withEntityAnalyzer(Class&lt;?&gt;)</div><div>queryBuilder.basedOnEntityAnalyzer(Class&lt;?&gt;)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.overridesForField(String field, Analyzer)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.overridesForField(String field, Analyzer)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.build() //sucky name</div></span></div></blockquote><div><br></div><div>Perhaps rename the static factory methods to something like:</div><div><br></div><div>QueryBuilder.getQueryBuilder(Analyzer)</div><div>QueryBuilder.getQueryBuilder(Class&lt;?&gt;)</div><div><br></div><div>and QueryBuilder instances have overrideAnalyzerForField(String, Analyzer). &nbsp;Why do you need the build() method at the end?</div></div></div></blockquote><div><br></div><div>if you do that, all of the sudden, a QB can change it's analyzer on the fly making it immutable.</div><div>Also the overridesForField methods would pollute the API when it's time to create a query.</div><div><br></div><div>One of the advantages of a fluent API in a strongly typed environment is that we can hide methods that are meaningless in a given context.</div><div><br></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>That been said, if the API ends up being pure Lucene and once we stabilize it, we can contribute it back even though I am not necessarily a huge fan of ASL.<br></div></blockquote><div><br></div><div>Not it doesn't have to be either ASL or even hosted at Apache. &nbsp;I guess what I am suggesting is perhaps even a separate project - LuceneQueryBuilder or something &nbsp;- which plain-old-Lucene users could use as well. &nbsp;Doesn't matter where it's hosted or what the license is - as long as its ASL or LGPL :)</div></div></div></blockquote></div><br><div>Let's start it under the Hibernate Search umbrella due to potential synergies and spin it out if needed.</div></div></blockquote><br></div><div>Ok. &nbsp;Just make sure we use a different maven module or something so that there are no dependencies on the rest of HS or Hibernate. &nbsp;Otherwise spinning out will be a PITA. &nbsp;Lucene should be the only dependencies of this code.</div><div><br></div>Cheers<br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>