Reformatting for readability:

Hi,
I'm looking for some advice on specific issue that is holding us back.

I'm trying to create a custom RequestHandler with the Solr api (solrj) that
makes a query call back to the server.

I'm not finding any good, run-able examples of this on-line. Possibly I'm
approaching this wrong. Any advice would be appreciated.

All I'm trying to do is query the data to see what are all of the values
used by some specific fields and then construct a XML response to send back
to the user. To get the information that I need, I have to do more than one
query and process some of the data returned. That is why I am using a
RequestHandler.

I know how to write these queries to get this information that is need.
They work fine individually but the issue is I'm having trouble using the
objects available within the RequestHandler to make the call back to the
server. The response is always 0 documents no matter how simple/broad your
query is. "q", "*:*"

Here is one of my attempts to coding this.

 public void handleRequestBody(SolrQueryRequest req,SolrQueryResponse rsp)
throws Exception {
  SolrCore solrServerCore= req.getCore();
  SolrRequestHandler handler =solrServerCore.getRequestHandler("/select");
  ModifiableSolrParams params =new ModifiableSolrParams();
  params1.add("q","*:*");
  SolrQueryRequest req= new LocalSolrQueryRequest(solrServerCore,params);
  SolrQueryResponse rsp= new SolrQueryResponse();;
  solrServerCore.execute(handler1,req, rsp);
  //!!!Not returning a structured response
  System.out.println(rsp.toString());
  System.out.println(rsp.getReturnFields());
  System.out.println(rsp.getValues().toString());

On Thu, May 18, 2017 at 2:37 PM, Jack Java <javajac...@yahoo.com.invalid>
wrote:

>
> Hi,I'm looking for some advice on specific issue that is holding usback.
> I'mtrying to create a custom RequestHandler with the Solr api (solrj)that
> makes a query call back to the server.
> I'mnot finding any good, run-able examples of this on-line. Possibly
> I'mapproaching this wrong. Any advice would be appreciated.
> AllI'm trying to do is query the data to see what are all of the
> valuesused by some specific fields and then construct a XML response tosend
> back to the user. To get the information that I need, I have todo more than
> one query and process some of the data returned. That iswhy I am using a
> RequestHandler.
> Iknow how to write these queries to get this information that is need.They
> work fine individually but the issue is I'm having trouble usingthe objects
> available within the RequestHandler to make the call backto the server. The
> response is always 0 documents no matter howsimple/broad your query is.
> "q", "*:*"Hereis one of my attempts to coding this.
>
>  publicvoidhandleRequestBody(SolrQueryRequest req,SolrQueryResponse rsp)
> throwsException {
>  SolrCoresolrServerCore= req.getCore(); SolrRequestHandlerhandler
> =solrServerCore.getRequestHandler("/select");  ModifiableSolrParamsparams
> =newModifiableSolrParams(); params1.add("q","*:*");  SolrQueryRequest req=
> newLocalSolrQueryRequest(solrServerCore,params); SolrQueryResponse rsp=
> newSolrQueryResponse();; solrServerCore.execute(handler1,req, rsp);
> //!!!Not returning a structured response System.out.println(rsp.toString());
> System.out.println(rsp.getReturnFields()); System.out.println(rsp.
> getValues().toString());
>
>
>

Reply via email to