Elasticsearch data layer for eve rest framework
Project description
Eve-Elastic is elastic data layer for eve REST framework.
Features
fulltext search
filtering via elasticsearch filter dsl
facets support
aggregations support
elasticsearch mapping generator for schema
License
Eve-Elastic is GPLv3 licensed.
Supported elastic versions
It supports elastic 7 versions.
Install
$ pip install Eve-Elastic
Usage
Set elastic as your eve data layer.
import eve
from eve_elastic import Elastic
app = eve.Eve(data=Elastic)
app.run()
Config
There are 2 options for Eve-Elastic taken from app.config:
ELASTICSEARCH_URL (default: 'http://localhost:9200/') - this can be either single url or list of urls
ELASTICSEARCH_INDEX - (default: 'eve')
ELASTICSEARCH_INDEXES - (default: {}) - resource to index mapping
ELASTICSEARCH_FORCE_REFRESH - (default: True) - force index refresh after every modification
ELASTICSEARCH_AUTO_AGGREGATIONS - (default: True) - return aggregates on every search if configured for resource
Query params
Eve-Elastic supports eve like queries via where param which work as term filter.
On top of this, there is a predefined query_string query which does fulltext search.
$ curl http://localhost:5000/items?q=foo&df=name
q - query (default: *)
df - default field (default: _all)
Filtering
For more sophisticated filtering, you can use filter query param which will be used as filter for the query, using elastic filter dsl.
Facets
To add a facets support for specific resource, add facets into its datasource:
DOMAIN = {
'contacts': {
'datasource':
'facets': {
'urgency': {'terms': {'field': 'urgency'}},
'versioncreated': {'date_histogram': {'field': 'versioncreated', 'interval': 'hour'}}
}
}
}
You will find more info about facets in elasticsearch docs.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eve_elastic-7.4.3.tar.gz.
File metadata
- Download URL: eve_elastic-7.4.3.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f86dbadd189ec1a4bfa59957f4a7929769dcfe2d7c5f821c538a06254559d1
|
|
| MD5 |
4037b2a8f214941948993903ecde5487
|
|
| BLAKE2b-256 |
1990932b5605095a14e1e14976950bf4d42f27b4cce48ea1554e904e61706b4f
|
Provenance
The following attestation bundles were made for eve_elastic-7.4.3.tar.gz:
Publisher:
publish-to-test-pypi.yml on superdesk/eve-elastic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eve_elastic-7.4.3.tar.gz -
Subject digest:
01f86dbadd189ec1a4bfa59957f4a7929769dcfe2d7c5f821c538a06254559d1 - Sigstore transparency entry: 156954415
- Sigstore integration time:
-
Permalink:
superdesk/eve-elastic@e7525fd5e67b35fbcec3f1225b6f90b219b12cca -
Branch / Tag:
refs/tags/v7.4.3 - Owner: https://github.com/superdesk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@e7525fd5e67b35fbcec3f1225b6f90b219b12cca -
Trigger Event:
push
-
Statement type:
File details
Details for the file Eve_Elastic-7.4.3-py3-none-any.whl.
File metadata
- Download URL: Eve_Elastic-7.4.3-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e396fd653b041ba87f62f9c6c9d54d7f7db752a2a2ae831659950e417d80b7e
|
|
| MD5 |
ef08d66f7ada17f586b6ca3e524aa28a
|
|
| BLAKE2b-256 |
975a39f7d90657be9a3a450c433d43f11a658ca0270cd546df3c8dad723be1dd
|
Provenance
The following attestation bundles were made for Eve_Elastic-7.4.3-py3-none-any.whl:
Publisher:
publish-to-test-pypi.yml on superdesk/eve-elastic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eve_elastic-7.4.3-py3-none-any.whl -
Subject digest:
9e396fd653b041ba87f62f9c6c9d54d7f7db752a2a2ae831659950e417d80b7e - Sigstore transparency entry: 156954416
- Sigstore integration time:
-
Permalink:
superdesk/eve-elastic@e7525fd5e67b35fbcec3f1225b6f90b219b12cca -
Branch / Tag:
refs/tags/v7.4.3 - Owner: https://github.com/superdesk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@e7525fd5e67b35fbcec3f1225b6f90b219b12cca -
Trigger Event:
push
-
Statement type: