It didn't work :(
I'm trying to change the SolrIndexer file to put the credentials but it's not
working. Something like this:
HttpClient adminClient = getHttpClient(solrUrl);
SolrServer solr = new CommonsHttpSolrServer(solrUrl, adminClient);
solr.commit();
I added the method getHttpClient like this:
private HttpClient getHttpClient(String solrServerUrl){
HttpClient adminClient = new HttpClient();
try {
HostConfiguration adminHost = adminClient.getHostConfiguration();
adminHost.setHost(new URI(solrServerUrl, true));
AuthScope adminScope = new
AuthScope(adminHost.getHost(),adminHost.getPort(),null, null);
adminClient.getState().setCredentials(adminScope,new
UsernamePasswordCredentials(myUser, myPwd));
}
catch (Exception e) {
e.printStackTrace();
}
return adminClient;
}
> From: [email protected]
> To: [email protected]
> Subject: Re: http authentication and multicore
> Date: Wed, 27 Oct 2010 20:21:59 +0200
> CC: [email protected]
>
>
> > Hi.
> >
> > I'm using nutch 1.2 to crawl a site and after that I want to index to solr
> > using solrIndexer command.
> >
> > The problem is that the solr server needs a Digest authentication, Is there
> > a way to authenticate from nutch?
>
> Never tried the authentication part, but i guess
> http://user:p...@host:port/servlet/corename/ will not only do the
> authentication but also send it to the proper core. At least, i'm sure
> sending
> data to the right core works because that's what i do.
>
> >
> > Another problem is that I'm using multicore in solr, how do I tell
> > solrIndexer that I'm using a multicore?
> >
> > Thanks
> > Juan