Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)
Contributor

Command to delete a particular solr collection:-


Example:-

curl "http://<SOLR-HOSTNAME>:8886/solr/audit_logs/update?commit=true" -H "Content-Type: text/xml" --data-binary "<delete><query>evtTime:[* TO NOW-7DAYS]</query></delete>"

In this example,

audit_logs - is the collection name.
TO NOW-7DAYS - Will delete the data older than 7 days.
989 Views
0 Kudos
Comments
Not applicable

thanks a lot.

New Contributor

I get the following error:

<?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">400</int><int name="QTime">1</int></lst><lst name="error"><lst name="metadata"><str name="error-class">org.apache.solr.common.SolrException</str><str name="root-error-class">org.apache.solr.parser.ParseException</str></lst><str name="msg">org.apache.solr.search.SyntaxError: Cannot parse 'evtTime:[* TO NOW- 7DAYS]': Encountered " <RANGE_GOOP> "7DAYS "" at line 1, column 19. Was expecting one of: "]" ... "}" ... </str><int name="code">400</int></lst>

Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎01-03-2018 07:25 PM
Updated by:
 
Contributors
Top Kudoed Authors