Skip to content

Instantly share code, notes, and snippets.

@robyoung
Created March 8, 2009 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robyoung/75746 to your computer and use it in GitHub Desktop.
Save robyoung/75746 to your computer and use it in GitHub Desktop.
doc = solrpy.Document(1.6)
# like a dictionary
doc['id'] = 1
doc['title'] = solrpy.Field("Lucene in Action", boost=1.5)
doc['author'] = ["Erik Hatcher", solrpy.Field("Otis Gospodnetić", boost=1.1)]
# or with add()
doc.add(id=1, title=solrpy.Field("Lucene in Action", boost=1.5), author=["Erik Hatcher", solrpy.Field("Otis Gospodnetić", boost=1.1)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment