Skip to content

Commit 1e32808

Browse files
more
1 parent a43bcfb commit 1e32808

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

CHANGELOG.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,25 @@ yyyy-mm-dd (not released yet)
2828
Do not keep things as they were in your own fork, since new search backends
2929
will use the `|` and `:` symbols differently.
3030

31-
**Shortcuts**
31+
**Old**
3232

3333
.. code-block:: text
3434
35+
http://127.0.0.1:8080/search/publisher/?search=name|reilly&search=city|london
36+
http://127.0.0.1:8000/search/publishers/?location__geo_distance=100000km|12.04|-63.93
37+
http://localhost:8000/api/articles/?id__terms=1|2|3
38+
http://localhost:8000/api/users/?age__range=16|67|2.0
39+
http://localhost:8000/api/articles/?id__in=1|2|3
3540
41+
**New**
42+
43+
.. code-block:: text
44+
45+
http://127.0.0.1:8080/search/publisher/?search=name:reilly&search=city:london
46+
http://127.0.0.1:8000/search/publishers/?location__geo_distance=100000km__12.04__-63.93
47+
http://localhost:8000/api/articles/?id__terms=1__2__3
48+
http://localhost:8000/api/users/?age__range=16__67__2.0
49+
http://localhost:8000/api/articles/?id__in=1__2__3
3650
3751
3852
- `SEPARATOR_LOOKUP_VALUE` has been removed. Use

basic_usage_examples.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ Search in all fields (``name``, ``address``, ``city``, ``state_province`` and
277277
**Search a single term on specific field**
278278

279279
In order to search in specific field (``name``) for term "reilly", add
280-
the field name separated with ``|`` to the search term.
280+
the field name separated with ``:`` to the search term.
281281

282282
.. code-block:: text
283283
284-
http://127.0.0.1:8080/search/publisher/?search=name|reilly
284+
http://127.0.0.1:8080/search/publisher/?search=name:reilly
285285
286286
**Search for multiple terms**
287287

@@ -300,7 +300,7 @@ fields add multiple ``search`` query params and field names separated with
300300

301301
.. code-block:: text
302302
303-
http://127.0.0.1:8080/search/publisher/?search=name|reilly&search=city|london
303+
http://127.0.0.1:8080/search/publisher/?search=name:reilly&search=city:london
304304
305305
Filtering
306306
^^^^^^^^^
@@ -373,7 +373,7 @@ Filter documents by radius of 100000km from the given location.
373373

374374
.. code-block:: text
375375
376-
http://127.0.0.1:8000/search/publishers/?location__geo_distance=100000km|12.04|-63.93
376+
http://127.0.0.1:8000/search/publishers/?location__geo_distance=100000km__12.04__-63.93
377377
378378
Ordering
379379
^^^^^^^^
@@ -386,7 +386,7 @@ Filter documents by field ``city`` (ascending).
386386

387387
.. code-block:: text
388388
389-
http://127.0.0.1:8080/search/publisher/?search=country|armenia&ordering=city
389+
http://127.0.0.1:8080/search/publisher/?search=country:armenia&ordering=city
390390
391391
**Order documents by field (descending)**
392392

nested_fields_usage_examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ the field name separated with ``|`` to the search term.
681681

682682
.. code-block:: text
683683
684-
http://127.0.0.1:8000/search/addresses/?search=city.country.name|Armenia
684+
http://127.0.0.1:8000/search/addresses/?search=city.country.name:Armenia
685685
686686
Nested filtering
687687
^^^^^^^^^^^^^^^^
@@ -980,7 +980,7 @@ Filter documents by field (``states``) "published" and "in_progress".
980980

981981
.. code-block:: text
982982
983-
http://127.0.0.1:8000/search/addresses/?city__in=Yerevan|Dublin
983+
http://127.0.0.1:8000/search/addresses/?city__in=Yerevan__Dublin
984984
985985
Ordering
986986
^^^^^^^^

src/django_elasticsearch_dsl_drf/tests/test_filtering_nested.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def test_field_filter_range(self):
175175
176176
Example:
177177
178-
http://localhost:8000/api/users/?age__range=16|67
178+
http://localhost:8000/api/users/?age__range=16__67
179179
"""
180180
# Pick the first and the last elements from the list
181181
lower_id = self.all_cities_ids[1]
@@ -202,7 +202,7 @@ def test_field_filter_range_with_boost(self):
202202
203203
Example:
204204
205-
http://localhost:8000/api/users/?age__range=16|67|2.0
205+
http://localhost:8000/api/users/?age__range=16__67__2.0
206206
"""
207207
lower_id = self.all_cities_ids[2]
208208
upper_id = self.all_cities_ids[4]
@@ -242,7 +242,7 @@ def test_field_filter_in(self):
242242
243243
Example:
244244
245-
http://localhost:8000/api/articles/?id__in=1|2|3
245+
http://localhost:8000/api/articles/?id__in=1__2__3
246246
"""
247247
ids = [
248248
self.addresses_in_yerevan[0].city.id,
@@ -288,7 +288,7 @@ def test_field_filter_terms_string(self):
288288
289289
Example:
290290
291-
http://localhost:8000/api/articles/?id__terms=1|2|3
291+
http://localhost:8000/api/articles/?id__terms=1__2__3
292292
"""
293293
return self._field_filter_value(
294294
'continent_country_city__terms',

0 commit comments

Comments
 (0)