You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Noble Paul നോബിള് नोब्ळ् <no...@gmail.com> on 2008/06/20 06:22:40 UTC
Use method chaining in SolrQuery
SolrQuery has umpteen no:of setter methods and one needs to invoke a
lot of them before sending the query. Can we make the 'setter' methods
return 'this' so that users can chain the method calls and make the
client code simpler.
as follows
SolrQuery solrQuery = new SolrQuery().
setQuery("ipod").
setFacet(true).
setFacetMinCount(1).
setFacetLimit(8).
addFacetField("category").
addFacetField("inStock");
--
--Noble Paul
Re: Use method chaining in SolrQuery
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
+1
On Jun 20, 2008, at 12:22 AM, Noble Paul നോബിള്
नोब्ळ् wrote:
> SolrQuery has umpteen no:of setter methods and one needs to invoke a
> lot of them before sending the query. Can we make the 'setter' methods
> return 'this' so that users can chain the method calls and make the
> client code simpler.
> as follows
>
> SolrQuery solrQuery = new SolrQuery().
> setQuery("ipod").
> setFacet(true).
> setFacetMinCount(1).
> setFacetLimit(8).
> addFacetField("category").
> addFacetField("inStock");
>
> --
> --Noble Paul