Extended haystack backend for Elasticsearch
Project description
Extended Haystack backend for Elasticsearch 5.
Quickstart
Install Django Haystack ES:
pip install django-haystack-es
Add haystack_es.ElasticsearchSearchEngine to your HAYSTACK_CONNECTIONS engine in settings.py
Example
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack_es.backends.Elasticsearch5SearchEngine',
# ...
}
}
Define your indexes using haystack_es.indexes instead of haystack.indexes.
Example
# myapp/search_indexes.py
from haystack_es import indexes
from myapp.models import MyModel
class MyModelIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
# ...
If you want to utilize additional SearchQuerySet methods use haystack_es.query.SearchQuerySet instead of haystack.query.SearchQuerySet.
Example
from haystack_es.query import SearchQuerySet
sqs = SearchQuerySet().filter(content='some query')
sqs.boost_fields({'name': 2, 'some_field': 1.5, 'another_field': 1})
sqs.facet('some_field')
# ...
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Based on
haystack-elasticsearch5: https://github.com/Alkalit/haystack-elasticsearch5
Tools used in rendering this package:
History
0.1.0 (2017-07-27)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-haystack-es-0.2.2.tar.gz
(13.4 kB
view hashes)
Built Distribution
Close
Hashes for django_haystack_es-0.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10ce8a09012f0056c1e20dbd5697965d60e820b75f14fe413f1f6c5e5e15eb65 |
|
MD5 | b5bb7e93b36f4d3847e0730bd050ef3b |
|
BLAKE2b-256 | ae6b175066d92a66f396a3eb0bf06ddee0c0143b5d787afccaeb48b733f2307d |