hi,
the solrQuery.setQuery() method just set the 'q' param in the query string.
You need call other method to set up all necessary param:
solrQuery.setFields(); --> this set up the 'fl' param
solrQuery.setStart(); --> this set up the 'start' param
solrQuery.setRows(); --> this set up the 'rows' param
solrQuery.setSort();  --> this set up the 'sort'param

You can look into
http://lucene.apache.org/solr/4_2_1/solr-solrj/org/apache/solr/client/solrj/SolrQuery.htmlto
see more details about SolrQuery.


2013/5/14 Luis Cappa Banda <luisca...@gmail.com>

> Hello, guys!
>
> I would like to do something like this. Let's suppose we have:
>
> *
> *
> *(...) *
> *
> *
> *String query = "q=*:*&start=0&rows=20&sort=date%20desc";*
> *
> *
> *SolrQuery solrQuery = new SolrQuery();*
> *solrQuery.setQuery(query);*
> *
> *
> *server.query(solrQuery);*
> *
> *
> *(...)*
>
>
>
> I tried that and it fails. My question is: is it possible to define a
> SolrQuery with the complete REST encoded query String without parsing
> manually all the query parameters and using SolrQuery methods to set them?
>
> Regards,
>
> --
> - Luis Cappa
>



-- 
------------------------------------------------------
不走弯路,就是捷径。
http://www.jnan.org/

Reply via email to