This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This is Django application that helps intergrate Django with elasticsearch. It is built on top of elasticsearch-dsl.



Project aims to support Python 3 and Django 1.8 (at least).

The library is in development, use it carefully, because until stable an API is a subject to change.

Quickstart

Configure your models to be indexable:

from django.db import models
from el.models import Indexed

class Article(models.Model, Indexed):
    title = models.CharField(max_length=78)

@classmethod
def get_indexable(cls):
    return cls.objects.all()

@classmethod
def configure_mapping(cls, mapping):
    # mapping is an elasticsearch_dsl Mapping object
    mapping.field('title', 'string')
    return mapping

From this moment, the Article model will be autodiscovered and indexed.

Update search indexes:

./manage.py update_index

Use elasticsearch_dsl to query:

# articles is a list of an Article instances
articles = Article.search().query('match', title="Bob's article").execute()

# articles is a list of elasticsearch_dsl hits
articles = Article.search().query('match', title="Bob's article").execute(cast=False)

In contrast with elasticsearch_dsl, django-el provides modified Search object which return django model instances instead of raw elasticsearch results by default. You can control this feature using the cast argument.

Installation

Install django-el as usual python package using pip:

pip install django-el

Configuration

Django-el is build on top of elasticsearch_dsl library and provides django-way connections configuration through settings.py:

ELASTICSEARCH_CONNECTIONS = {
    'default': {
        'hosts': ['127.0.0.1:9200'],
        'serializer': 'project.serializers.MySerializer',
    }
}

You can define project connections using ELASTICSEARCH_CONNECTIONS setting. It is just a hight-level interface over low-level elasticsearch_dsl.connections.connections.create_connection function.

The keys are (default, in this example) are connection aliases, and it’s values are create_connection arguments.

Release History

Release History

0.2.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-el-0.2.2.tar.gz (7.0 kB) Copy SHA256 Checksum SHA256 Source Nov 18, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting