1

A little background:

  • I want to use Django Search with Lucene
  • I have Django 1.1 w/ Python 2.5 installed
  • MySQL 5.1 is being used
  • My local machine is running Windows Vista x64, but we will deploy to Red Hat Linux
  • Yes, I wish that right about now I was running Linux.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mkelley33
  • 5,323
  • 10
  • 47
  • 71
  • 2
    If you're going to deploy on Linux, then you really, *really* want to get a linux server (hosted or something in the closet). And you want to do this now, as opposed to a week before you are ready to deploy. Really. – Peter Rowell Nov 10 '09 at 03:06
  • 1
    Or even just install Red Hat on your dev machine - via vmware or virtualbox if nothing else. – Daniel Roseman Nov 10 '09 at 09:55
  • I gotta say Pete and Daniel: those are both excellent suggestions, but other people our team are using Windows, and while I could hold them down and force them to install linux, I'm afraid I'm not in a position to impose that requirement. I'll suggest it, and hopefully, everyone will agree your suggestions. Thanks again. – mkelley33 Nov 10 '09 at 15:00

1 Answers1

3

I would recommend Apache SOLR, which is built on top of Lucene. The primary advantage is that it exposes an easy to use API, and can return a native Python object. Here is an example of how to call it from Python:

params = urllib.urlencode({        
    "rows": "100",       
    "fl": "id,name,score,address,city,state,zip",        
    "wt": "python",        
    "q": "+name:Foo +city:Boston"
})        

request = urllib2.urlopen(urllib2.Request("http://locahost:8983/solr/select", params))
response = ast.literal_eval(request.read())
request.close()            
return response["docs"] 
Chase Seibert
  • 15,703
  • 8
  • 51
  • 58