Created
March 8, 2009 11:28
-
-
Save robyoung/75733 to your computer and use it in GitHub Desktop.
solrpy quickstart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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