Skip to content
This repository

Add 'mean' and 'reverse_mean' orderings for TermStatsFacet #279

Merged
merged 1 commit into from over 1 year ago

2 participants

Alberto Paro

Hello,

This is small update to add 'mean' and 'reverse_mean' ordering values for TermStatsFacet.
Please look here http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/

Thanks.

Alberto Paro aparo merged commit 6f3003b into from
Alberto Paro aparo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 07, 2013
piterimov Add 'mean' and 'reverse_mean' orderings for TermStatsFacet ee1a92b
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 pyes/facets.py
5 pyes/facets.py
@@ -343,8 +343,9 @@ def __init__(self, name, size=10, order=None, key_field=None, value_field=None,
343 343 key_script=None, value_script=None, params=None, **kwargs):
344 344 super(TermStatsFacet, self).__init__(name, **kwargs)
345 345 self.size = size
346   - self.ORDER_VALUES = ['term', 'reverse_term', 'count', 'reverse_count', 'total',
347   - 'reverse_total', 'min', 'reverse_min', 'max', 'reverse_max']
  346 + self.ORDER_VALUES = ['term', 'reverse_term', 'count', 'reverse_count',
  347 + 'total', 'reverse_total', 'min', 'reverse_min',
  348 + 'max', 'reverse_max', 'mean', 'reverse_mean']
348 349 self.order = order if order is not None else self.ORDER_VALUES[0]
349 350 self.key_field = key_field
350 351 self.value_field = value_field

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.