Search code examples
javasearchsolrsystemsolrj

Index my Hard drive into solr


I want to index my system each files and folders information into solr. Is there any handler in solr to do it?
I can index any file using data import handler using below command

curl "http://localhost:8983/solr/update/extract?ext.idx.attr=true\&ext.def.fl=text&commit=true" -F "myfile=@tmp1.txt"

But i want to index my whole system into solr.


Solution

  • It looks like it could be done via http://wiki.apache.org/solr/DataImportHandler#FileListEntityProcessor, you could specify

    fileName :(required) A regex pattern to identify files

    baseDir : (required) The Base directory (absolute path)

    recursive : Recursive listing or not. Default is 'false'

    If you specify fileName as '*', baseDir as '/', recursive as 'true' it looks like it will enumerate all files.