<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 25 Aug 2009, at 11:46, Manik Surtani wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On 25 Aug 2009, at 11:09, Emmanuel Bernard wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 25 août 09, at 11:33, Manik Surtani wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">CacheQuery cq = new QueryFactory(cache).getQuery("fieldName",<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"stuffToSearchFor");<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Looks good. &nbsp;But I think we should also support Lucene queries<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">directly, as they provide a richer set of searchable terms and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">constraints. &nbsp;Or perhaps impls like BooleanQuery to combine queries.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">E.g.:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">        </span>Query luceneQuery = createComplexLuceneQuery();<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">        </span>CacheQuery cq = new QueryFactory(cache).getQuery(luceneQuery);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">See:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">        </span><a href="http://lucene.apache.org/java/2_4_1/api/core/org/apache/lucene/search/Query.html">http://lucene.apache.org/java/2_4_1/api/core/org/apache/lucene/search/Query.html</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It's a fine line to add "easy" query object factory methods:<br></blockquote><blockquote type="cite"> - this single term query is often not enough<br></blockquote><blockquote type="cite"> - even when it is, are you doing a TermQuery, a FuzzyTermQuery<br></blockquote><blockquote type="cite">(which fuzzy factor), a PrefixQuery or even why not a RangeQuery?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">where are you going to draw the line? I would rather see some DSL to<br></blockquote><blockquote type="cite">build Lucene queries which I would like to work on for HSearch as soon<br></blockquote><blockquote type="cite">as free time comes by.<br></blockquote><br>Aren't there standards around this already?<br></div></blockquote><div><br></div><div>If you're talking about API methods here then I believe that HS deals with any type of Lucene query.</div><div><br></div><div>The issue with&nbsp;doing&nbsp;something&nbsp;like:&nbsp;-&nbsp;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>CacheQuery cq = new QueryFactory(cache).getQuery(luceneQuery);</div><div><br></div><div>is that to create a lucene query then you need to do the work of creating up a QueryParser and stuff like that. This is the bit that I'd like to avoid.</div><div><br></div><div>Is it too round-about / tricky / yucky if we the user is to provide the specific class of the query? Or is that what you were suggesting anyway Manik?</div><div><br></div><div>e.g.: -&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space: pre; ">        </span>CacheQuery cq = new QueryFactory(cache).getQuery(org.apache.lucene.query.BooleanQuery.<b><i>class</i></b>);</div><div><br></div><div>If&nbsp;I'm&nbsp;completely&nbsp;off&nbsp;topic&nbsp;and&nbsp;talking&nbsp;rubbish&nbsp;then&nbsp;just&nbsp;ignore&nbsp;:).&nbsp;</div><blockquote type="cite"><div><blockquote type="cite"></blockquote></div></blockquote><div><br></div><br><blockquote type="cite"><div><br><br>--<br>Manik Surtani<br><a href="mailto:manik@jboss.org">manik@jboss.org</a><br>Lead, Infinispan<br>Lead, JBoss Cache<br>http://www.infinispan.org<br>http://www.jbosscache.org<br><br><br><br><br><br>_______________________________________________<br>infinispan-dev mailing list<br>infinispan-dev@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/infinispan-dev<br></div></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; 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: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Navin Surtani</div><div><br></div><div>Intern Infinispan</div><div>Intern JBoss Cache Searchable</div></div></span> </div><br></body></html>