I have just found out myself:
from pyes import *
from pyes.facets import *
conn = ES('localhost:9200', default_indices='org', default_types='activity')
q2 = MatchAllQuery().search()
# Displays the ES JSON query.
resultset = conn.search(q2)
# To display the all resultsets.
for r in resultset:
# To display the facet counts.
This code gives the above JSON Code and gives the exact count for me.
On Thursday, September 6, 2012 12:00:39 PM UTC+5:45, Suraj Tamang wrote:
I have a following query and I want to change that query into PyES:
I have searched in PyES documentation about:
- class pyes.facets.TermsFacetFilter(field=None, values=None, _name=None,
And I don't know how to use it plus I couldn't find any examples related
to it. Hoping to see PyES guys coming out with good documentation with
examples in future.