pythondjangodjango-search-lucene

Can I use Django 1.1 with django-search-lucene for full-text searching, and if so, what resources/links/docs can I reference to get it up and running?


A little background:


Solution

  • 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"]