Montag, 15. Oktober 2012

Solr Commands

This is just a notepad for Solr curl commands. Solr is a search engine. Wiki can be found here.

Add a binary document
curl "http://localhost:8983/solr/update/extract?literal.id=doc1&commit=true" -F "mydocument=@your_document.pdf"

Add a CSV file
curl 
"http://localhost:8983/solr/update/csv?stream.file=exampledocs/document.csv&separator=;&commit=true&optimze=true&stream.contentType=text/plain;charset=utf-8"
Keep in mind, that you need to specify fields in you CSV file in schema.xml.
Delete entire index
# query to delete index
curl http://localhost:8983/solr/update --data '*:*' -H 'Content-type:text/xml; charset=utf-8'
# commit changes
curl http://localhost:8983/solr/update --data '' -H 'Content-type:text/xml; charset=utf-8'

Sonntag, 7. Oktober 2012

How to list old files on Windows

Today just a quick one. Following command outputs all files that are older than 57 days. Quite handy for many stuff :)

forfiles /p k:\ /d -57 /c "cmd /c echo @FILE:@FDATE"