Last active
August 3, 2020 23:26
-
-
Save Crell/73e113e293797d13fbb0c3e60bc2dc2f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FetchError: request to http://solr.internal:8080/solr/maincore/update? failed, reason: connect ECONNREFUSED 169.254.143.220:8080 | |
at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1455:11) | |
at ClientRequest.emit (events.js:314:20) | |
at Socket.socketErrorListener (_http_client.js:469:9) | |
at Socket.emit (events.js:314:20) | |
at emitErrorNT (internal/streams/destroy.js:100:8) | |
at emitErrorCloseNT (internal/streams/destroy.js:68:3) | |
at processTicksAndRejections (internal/process/task_queues.js:80:21) { | |
type: 'system', | |
errno: 'ECONNREFUSED', | |
code: 'ECONNREFUSED' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const solr = require('solr-node'); | |
const config = require("platformsh-config").config(); | |
exports.usageExample = async function() { | |
client = new solr({host: 'solr.internal', port: 8080, core: 'maincore', protocol: 'http'}); | |
let output = ''; | |
// Add a document. | |
let addResult = await client.update({ | |
id: 123, | |
name: 'Valentina Tereshkova', | |
}); | |
output += "Adding one document. Status (0 is success): " + addResult.responseHeader.status + "<br />\n"; | |
// Flush writes so that we can query against them. | |
await client.softCommit(); | |
// Select one document: | |
let strQuery = client.query().q(); | |
let writeResult = await client.search(strQuery); | |
output += "Selecting documents (1 expected): " + writeResult.response.numFound + "<br />\n"; | |
// Delete one document. | |
let deleteResult = await client.delete({id: 123}); | |
output += "Deleting one document. Status (0 is success): " + deleteResult.responseHeader.status + "<br />\n"; | |
return output; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment