Example usage of filtering backends.
Table of Contents
- Filter usage examples
- Usage examples
Query param name reserved for search is
search. Make sure your models and
documents do not have it as a field or attribute.
Multiple search terms are joined with
Let’s assume we have a number of Book items with fields
Search in all fields (
country) for word “reilly”.
In order to search in specific field (
name) for term “reilly”, add
the field name separated with
| to the search term.
In order to search for multiple terms “reilly”, “bloomsbury” add
search query params.
The following native (to Elasticsearch) filters/lookups are implemented:
Find documents which contain the exact term specified in the field specified.
Find documents where the field specified contains values (dates, numbers, or strings) in the range specified.
Find documents where the field specified contains terms which begin with the exact prefix specified.
Find documents where the field specified contains terms which match the pattern specified, where the pattern supports single character wildcards (?) and multi-character wildcards (*)
The following functional (non-native to Elasticsearch, but common in Django) filters/lookups are implemented: