Sometimes we need to customize the agent used to communicate with Solr. In my specific use case, I need to enable HTTP keep-alive, but I can think of other uses.
The custom agent could be specified when creating the client:
var client = new SolrNode({
host: '127.0.0.1',
port: '8983',
core: 'test',
protocol: 'http',
agent: new https.Agent({ keepAlive: true })
});
Sometimes we need to customize the agent used to communicate with Solr. In my specific use case, I need to enable HTTP keep-alive, but I can think of other uses.
The custom agent could be specified when creating the client: