Look at the source code for SolrJ, you'll find it is just a glorified
HashMap, and you might find a way to interact with it that suits you (I
think the end URL is just the result of calling toString() on the
HashMap).

Upayavira

On Tue, May 14, 2013, at 10:13 AM, Luis Cappa Banda wrote:
> I know that, but I was wondering if it exists another way just to set the
> complete query (including q, fq, sort, etc.) embedded in a SolrQuery
> object
> as the same way that you query using some kind of RequestHandler. That
> way
> would be more flexible because you don't need to parse the complete query
> checking q, fg, sort... parameters one by one and setting them with
> setFields(), setStart(), setRows(), etcetera. Solr is doing that query
> parse internally when you execute queries with it's REST API and maybe
> there exist a way to re-use that functionality to just set a String to a
> SolrQuery and that SolrQuery does internally all the magic.
> 
> Thanks in advance,
> 
> 
> 2013/5/14 Jienan Duan <jnd...@gmail.com>
> 
> > 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/
> >
> 
> 
> 
> -- 
> - Luis Cappa

Reply via email to