Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sophilabs/django-solr
Solr Search Engine ORM for Django
https://github.com/sophilabs/django-solr
django solr unmaintained
Last synced: 18 days ago
JSON representation
Solr Search Engine ORM for Django
- Host: GitHub
- URL: https://github.com/sophilabs/django-solr
- Owner: sophilabs
- License: bsd-3-clause
- Created: 2011-09-06T17:26:51.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2016-11-11T12:51:02.000Z (about 8 years ago)
- Last Synced: 2024-04-17T05:46:15.210Z (9 months ago)
- Topics: django, solr, unmaintained
- Language: Python
- Homepage: http://sophilabs.github.com/django-solr/
- Size: 83 KB
- Stars: 25
- Watchers: 31
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Solr Search Engine ORM for Django
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
## Usage
Define
from djangosolr import documents
class Movie(documents.Document):
id = documents.IntegerField(primary_key=True)
title = documents.CharField()
director = documents.CharField()
text = TextField()Define from an existing django model
from djangosolr import documents
from myapp import modelsclass Movie(documents.Document):
class Meta:
model = models.Movie
Save some movies
Movie(id="1", title='Jurassic Park I', director='Steven Spielberg').save()
Movie(id="2", title='Jurassic Park III', director='Steven Spielberg').save()Save many movies at once
from djangosolr import solrsolr.save([m1, m2])
Get and updatem = Movie.documents.get(2)
m.director = 'Joe Johnston'
m.save()
Get all moviesms = Movie.documents.all()
Get the first 10 Steven Spielberg's movies
ms = Movie.documents.q(director__exact='Steven Spielberg').sort('title')[:10]
Get Spielberg's or Johnston's movies
ms = Movie.documents.q(Q(text='spielberg') | Q(text='johnston'))
Delete a movie
m = Movie.documents.get(1)
m.delete()Delete all movies
Movie.documents.clear()
## Getting It
You can get Django Solr by using pip or easy_install
$ pip install django-solr
or
$ easy_install django-solr## Comming Soon
* Facet
* More Like This