Skip to content

Commit 8990ec7

Browse files
committed
Document different facet classes
1 parent 0f234cf commit 8990ec7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/faceted_search.rst

+19
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ declaring a ``FacetedSearch`` subclass:
3434
values should be instances of any ``Facet`` subclass, for example: ``{'tags':
3535
TermsFacet(field='tags')``
3636

37+
38+
Facets
39+
~~~~~~
40+
41+
There are several different facets available"
42+
43+
``TermsFacet``
44+
provides an option to split documents into groups based on a value of a field, for example ``TermsFacet(field='catgeory')``
45+
46+
``DateHistogramFacet``
47+
split documents into time intervals, example: ``DateHistogramFacet(field="published_date", interval="day")``
48+
49+
``HistogramFacet``
50+
simmilar to ``DateHistogramFacet`` but for numerical values: ``HistogramFacet(field="rating", interval=2)``
51+
52+
``Rangefacet``
53+
allows you to define your own ranges for a numerical fiels:
54+
``Rangefacet(field="comment_count", ranges=[("few", (None, 2)), ("lots", (2, None))])``
55+
3756
Advanced
3857
~~~~~~~~
3958

0 commit comments

Comments
 (0)