barseghyanartur / django-elasticsearch-dsl-drf

Integrate Elasticsearch DSL with Django REST framework.
https://pypi.python.org/pypi/django-elasticsearch-dsl-drf
374 stars 121 forks source link

Filter feature 'not contains' suggestion #216

Open allwinjandrews opened 4 years ago

allwinjandrews commented 4 years ago

I am working on integrating Elastic Search in my existing Django REST application. In their documentation 'exclude' query param is provided. But the query only when we provide the full field value.

search-url?field__exclude=<field-value

For eg: If I have a value 'Stackoverflow' in field 'name'. I'll have to provide query param a ?name__exclude=Stackoverflow to exclude records having 'Stackoverflow' as name in the result.

Describe the solution you'd like

I would like to implement a search in such a way that when I provide 'over', I need to exclude these records, similar to ?name__exclude=over. This should exclude records containing 'over' in the field value

barseghyanartur commented 3 years ago

Is this search functionality or filter functionality?

If search, you could use simple query string backend for this.