Here is a minimal example.
I have an index 'test_index'
with the following records:
{u'name': u'b'}
{u'name': u'e'}
{u'name': u'a'}
{u'name': u'c'}
{u'name': u'd'}
I want to get the records in alphabetical order of the 'name'
field. I use the sort
argument, but the result is not sorted:
q = pyes.query.MatchAllQuery().search()
tuple(record['name'] for record in conn.search(q, indices = 'test_index', sort = 'name'))
Result:
(u'b', u'c', u'd', u'e', u'a')
What am I doing wrong here?