lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noor <noo...@opentechindia.com>
Subject Custom Request handler Error:
Date Fri, 12 Jun 2009 10:56:50 GMT
hi,
  i am new to apache solr.
I need to create a custom request handler class. So i create a new one 
and changed the solr-config.xml file as,
   <requestHandler name="/select" class="solr.my.MyCustomHandler">
        <lst name="defaults">
            <str name="echoParams">explicit</str>
            <str name="q">tandem</str>
            <str name="debugQuery">true</str>
        </lst>
    </requestHandler>

And in my java class, the code is,

public class MyCustomHandler extends RequestHandlerBase{
   public CoreContainer coreContainer;
   public void handleRequestBody(SolrQueryRequest request, 
SolrQueryResponse response) throws Exception {
        SolrCore coreToRequest = coreContainer.getCore("core2");
        ModifiableSolrParams params = new ModifiableSolrParams();
        params.set("echoParams", "explicit");
        params.set("q", "text");
        params.set("debugQuery", "true");
request = new LocalSolrQueryRequest(coreToRequest, params);
//      
        SolrRequestHandler reqHandler = 
coreToRequest.getRequestHandler("/select");
        coreToRequest.execute(reqHandler, request, response);
        coreToRequest.close();
        request.close();
    }
  // the abstract methods - getDescription(), getSourceId(), 
getSource(), getVersion() are //overrided... but these methods doesn't 
have any implementations.
}


But, if i search any text in my webapp from browser, gots the HTTP 500 
error.
i dont know how SolrContainer is intialized....
Pls anyone give me the solution...

thanks and regards,
Mohamed

Mime
View raw message