Skip to content

Commit 547c14a

Browse files
committed
update docs to reflect changes in FacetedSearch
1 parent 7e901c1 commit 547c14a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Changelog
44
=========
55

6+
0.0.9 (dev)
7+
-----------
8+
* ``FacetedSearch`` now uses its own ``Facet`` class instead of built in
9+
aggregations
10+
611
0.0.8 (2015-08-28)
712
------------------
813
* ``0.0.5`` and ``0.0.6`` was released with broken .tar.gz on pypi, just a build fix

docs/faceted_search.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ declaring a ``FacetedSearch`` subclass:
3131

3232
``facets``
3333
dictionary of facets to display/filter on. The key is the name displayed and
34-
values should be a (non nesting) bucket aggregations, for example: ``{'tags':
35-
Terms{field='tags'}}``
34+
values should be instances of any ``Facet`` subclass, for example: ``{'tags':
35+
TermsFacet(field='tags')``
3636

3737
Advanced
3838
~~~~~~~~
@@ -82,8 +82,7 @@ Example
8282
8383
from datetime import date
8484
85-
from elasticsearch_dsl import FacetedSearch
86-
from elasticsearch_dsl.aggs import Terms, DateHistogram
85+
from elasticsearch_dsl import FacetedSearch, TermsFacet, DateHistogramFacet
8786
8887
class BlogSearch(FacetedSearch):
8988
doc_types = [Article, ]
@@ -92,8 +91,8 @@ Example
9291
9392
facets = {
9493
# use bucket aggregations to define facets
95-
'tags': Terms(field='tags'),
96-
'publishing_frequency': DateHistogram(field='published_from', interval='month')
94+
'tags': TermsFacet(field='tags'),
95+
'publishing_frequency': DateHistogramFacet(field='published_from', interval='month')
9796
}
9897
9998
def search(self):

0 commit comments

Comments
 (0)