Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bultakov/drf-elasticsearch

Integrate Elasticsearch DSL with Django REST framework in the shortest way possible, with least efforts possible.
https://github.com/bultakov/drf-elasticsearch

django django-elasticsearch-dsl django-rest-framework drf elasticsearch

Last synced: about 2 months ago
JSON representation

Integrate Elasticsearch DSL with Django REST framework in the shortest way possible, with least efforts possible.

Awesome Lists containing this project

README

        

# DRF ElasticSearch

## Example

### Download project

```shell
git clone https://github.com/bultakov/DRF-ElasticSearch.git
```

```shell
cd DRF-ElasticSearch
```

```shell
python manage.py shell
```

```python3
from search.documents import ProductDocument

products = ProductDocument.search().query('match', name='mahsulot')
for product in products:
print(f"Name: {product.name}, Type: {product.product_type}")
```

- http://127.0.0.1:8000/search/product/mahsulot/