class pyes.facets.TermsFacetFilter(field=None, values=None, _name=None,
execution=None, *kwargs)
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.
from pyes import *
from pyes.facets import *
conn = ES('localhost:9200', default_indices='org', default_types='activity')
q2 = MatchAllQuery().search()
q2.facet.add_term_facet('participating-org.role', nested="participating-org")
# Displays the ES JSON query.
print q2
resultset = conn.search(q2)
# To display the all resultsets.
for r in resultset:
print r
# To display the facet counts.
print resultset.facets
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:
class pyes.facets.TermsFacetFilter(field=None, values=None, _name=None,
execution=None, *kwargs)
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.