Created on 01-03-2018 07:25 PM
Command to delete a particular solr collection:-
Created on 01-05-2018 12:56 AM
thanks a lot.
Created on 04-27-2018 11:11 AM
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>
Created on 08-04-2022 02:28 AM
Hello @achandra, This is an Old Post yet closing the same by sharing the feedback concerning your ask for wider audience. The API is failing owing to Space between "NOW-" & "7DAYS". There shouldn't be any gap between the same.
In Summary, the Command is below, where Customer needs to set the HTTP(s) header, Solr Host & Solr Port accordingly. Additionally, the Example uses "ranger_audits" Collection & "evtTime" field to delete any Documents older than 7 Days:
### curl -k --negotiate -u : "http[s]://<Any Solr Host FQDN>:<Solr Port>/solr/ranger_audits/update?commit=true" -H "Content-Type: text/xml" --data-binary "<delete><query>evtTime:[* TO NOW-7DAYS]</query></delete>"
Regards, Smarak