Actions6
Overview
This node integrates with Apache Solr, a powerful open-source search platform, allowing users to perform various document management and search operations. Specifically, the "Add or Update Document" operation enables adding new documents or updating existing ones in a Solr index. This is useful for keeping your search index up-to-date with the latest data changes, such as adding new products, updating user profiles, or modifying content metadata.
Practical examples include:
- Adding a new product catalog entry to Solr for e-commerce search.
- Updating an existing document's fields after content edits.
- Overwriting documents while ignoring version conflicts to ensure the latest data is indexed immediately.
Properties
| Name | Meaning |
|---|---|
| Commit | Whether to make the changes immediately visible in Solr (true/false). |
| Document | The JSON-formatted document to add or update in Solr. |
| Ignore Version Conflict (Overwrite) | If enabled, overwrites the document ignoring any version conflicts, potentially overwriting concurrent changes. |
Output
The output contains a JSON object representing the response from Solr after attempting to add or update the document(s). This typically includes status information about the operation's success or failure.
Example structure of the json output field:
{
"responseHeader": {
"status": 0,
"QTime": 1
},
"response": {
"numFound": 1,
"start": 0,
"docs": [
{
"id": "document_id",
"field1": "value1",
...
}
]
}
}
If multiple documents are added or updated at once, the response will reflect the batch operation result.
The node does not output binary data.
Dependencies
- Requires an Apache Solr instance accessible via network.
- Needs credentials including host, port, core, path, and optionally username/password for basic authentication.
- Uses the
@magierin-schnee/solr-clientlibrary internally to communicate with Solr. - Requires configuration of an API key credential or equivalent authentication token in n8n to connect securely to Solr.
Troubleshooting
Common Issues:
- Incorrect Solr connection details (host, port, core) can cause connection failures.
- Invalid JSON format in the "Document" property will cause parsing errors.
- Version conflicts when updating documents if "Ignore Version Conflict" is disabled.
- Insufficient permissions or missing authentication credentials may lead to authorization errors.
Error Messages:
"error": "Invalid JSON"— Check that the document JSON is well-formed.- Connection timeout or refused — Verify Solr server availability and network settings.
"version conflict"errors — Enable "Ignore Version Conflict" to overwrite or handle concurrency properly.- Authentication failures — Confirm credentials are correctly set and have necessary access rights.