Solr icon

Solr

Interact with Apache Solr

Overview

This node integrates with Apache Solr, a powerful search platform, to perform various document management and search operations. Specifically, the "Delete by Field" operation allows users to delete documents from a Solr index based on a specified field name and its value. This is useful when you want to remove all documents matching certain criteria without specifying individual document IDs.

Common scenarios include:

  • Cleaning up outdated or irrelevant documents that share a common attribute.
  • Removing documents related to a specific category or tag.
  • Bulk deletion based on dynamic field values during data synchronization or maintenance.

For example, if you have a Solr index of products and want to delete all documents where the field category equals discontinued, this operation will efficiently remove those entries.

Properties

Name Meaning
Commit Whether to make the changes immediately visible in Solr after deletion (true or false).
Field Name The name of the field used to identify which documents to delete (e.g., category).
Field Value The value of the field to match for deletion (e.g., discontinued).

Output

The output contains a JSON object representing the response from the Solr server after attempting the deletion. It typically includes status information about the deletion operation.

Example structure of the output JSON:

{
  "responseHeader": {
    "status": 0,
    "QTime": 5
  }
}
  • A status of 0 generally indicates success.
  • Other fields may provide additional metadata about the operation.

No binary data is produced by this operation.

Dependencies

  • Requires an active connection to an Apache Solr instance.
  • Needs credentials including host, port, core, path, and optionally username/password for basic authentication.
  • The node depends on the @magierin-schnee/solr-client library to interact with Solr.
  • Proper configuration of the Solr API credentials within n8n is necessary.

Troubleshooting

  • Common Issues:

    • Incorrect field name or value leading to no documents being deleted.
    • Network connectivity issues preventing communication with the Solr server.
    • Authentication failures if username or password are incorrect or missing.
    • Attempting to delete documents from a non-existent core or collection.
  • Error Messages:

    • Errors returned from Solr usually contain descriptive messages; for example, "Field not found" or "Unauthorized".
    • If the node throws an error about connection failure, verify the host, port, and network accessibility.
    • Version conflicts or commit failures might occur if Solr is under heavy load or misconfigured.
  • Resolutions:

    • Double-check the field name and value for typos.
    • Ensure the Solr core exists and is accessible.
    • Verify credentials and permissions.
    • Enable the "Commit" option to make sure deletions are applied immediately.

Links and References

Discussion