1

I'm trying to implement file search engine using django-haystack and some. I've already setup solr and able to query from solr UI. I tried to use haystack to provide file search. I've a directory containing files which gets updated regularly. I want to implement file search without creating any models on django side. I tried searching about it. All I could find the examples with SearchIndexes using django models. I just want to return matched file name and contents context to the users, for example, file name and matching 2 or 3 line. The files are served statically from the directory using web server handling static traffic. The UGLY way is to make a http request to solr api and parse json response but I don't want that. Please help.

Humble Learner
  • 791
  • 12
  • 26
  • I typically make sure my static files for picture uploads ect... always have a database model in django they get entered into. That way I can override the on delete method in the django model file to find the file on the filesystem and delete it. I've gone your route before and ended up with a mess of unused files that no longer had references etc... Hopefully somebody could answer your direct question though, my advice is just to reconsider how you plan to keep track of all of these files. – Chris Hawkes Feb 03 '15 at 16:03
  • I don't really need to track the files. There is no association with user or any other model. – Humble Learner Feb 03 '15 at 16:05
  • from my quick search results it seems like customized crawler needs to be created. http://stackoverflow.com/questions/25607608/example-of-file-system-search-using-apache-solr-4-0 – Chris Hawkes Feb 03 '15 at 16:10
  • @ChrisHawkes: I've already build an index. So, the only question is to use api to retrieve the data. I don't think I need to write a crawler for that. – Humble Learner Feb 09 '15 at 04:27

0 Answers0