From 099b1328f38bf05efe5ecd42265a5139c81a7996 Mon Sep 17 00:00:00 2001 From: Nick O'Sullivan Date: Wed, 25 Mar 2020 18:22:30 +0000 Subject: [PATCH] Port should be optional #219 --- lib/solr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/solr.js b/lib/solr.js index 73cbddc8..8c32cff6 100644 --- a/lib/solr.js +++ b/lib/solr.js @@ -69,7 +69,7 @@ function createClient(host, port, core, path, agent, secure, bigint, solrVersion * * @param {Object} options - set of options used to request the Solr server * @param {String} options.host - IP address or host address of the Solr server - * @param {Number|String} options.port - port of the Solr server + * @param {Number|String} options.port - port of the Solr server, 0 to be ignored by HTTP agent in case of using API endpoint. * @param {String} options.core - name of the Solr core requested * @param {String} options.path - root path of all requests * @param {http.Agent} [options.agent] - HTTP Agent which is used for pooling sockets used in HTTP(s) client requests @@ -85,7 +85,7 @@ function createClient(host, port, core, path, agent, secure, bigint, solrVersion function Client(options){ this.options = { host : options.host || '127.0.0.1', - port : options.port || '8983', + port : options.port === 0 ? 0 : options.port || '8983', core : options.core || '', path : options.path || '/solr', agent : options.agent,