Skip to content

Instantly share code, notes, and snippets.

@robyoung
Created March 8, 2009 11:28
Show Gist options
  • Save robyoung/75733 to your computer and use it in GitHub Desktop.
Save robyoung/75733 to your computer and use it in GitHub Desktop.
solrpy quickstart
import solrpy
conn = solrpy.SolrConnection('http://search.example.com/solr')
conn.add(id=1, title="Lucene in Action", author=["Erik Hatcher", "Otis Gospodnetić"])
conn.commit()
response = conn.query("lucene")
for result in response.results:
print "%d - %s" % (result['id'], result['title'])
conn.delete(1)
conn.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment