Skip to content

Simple queryset-like api for pysolr with dynamic field support

Notifications You must be signed in to change notification settings

gardeman/dyna-solr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dyna-solr

Simple queryset-like api for pysolr with dynamic field support.

Configure

from dyna_solr import solr
solr.config.from_dict(URL='http://127.0.0.1:8983/solr/')

Documents

from dyna_solr import Document, CharField, DateField

class Book(Document):

    title = CharField()
    author = CharField()
    genre = CharField()
    pub_date = DateField()

Index

book = Book(title='Dynamic Solr', author='Jonas')
Book.docs.add(book)

Query

Document queries are chained...

# Iterate all books
for book in Book.docs.all():
    print book.title

books = Book.docs.all()

# Filter
books = books.filter(author='Jonas')

# Facet
books = books.facet('author')

# Group by field and optionally affect facets
books = books.group_by('genre', facet=True)

# Offset and limit
books = books[5:10]

About

Simple queryset-like api for pysolr with dynamic field support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%