pyes icon indicating copy to clipboard operation
pyes copied to clipboard

pyes.managers.Indices optimize method not optimizing

Open untergeek opened this issue 13 years ago • 3 comments

conn.indices.optimize(indices='logstash-2012.09.06', wait_for_merge=True, max_num_segments=1) {u'ok': True, u'_shards': {u'successful': 8, u'failed': 0, u'total': 8}}

In spite of "wait_for_merge" being set to true, it immediately returns and it does not optimize, even in the background.

I've taken to doing a GET call in urllib3 to do the optimize in the meanwhile.

untergeek avatar Sep 07 '12 17:09 untergeek

Can you check if it works in the latest head? If not, what's the respective urllib3 call that works?

gsakkis avatar Dec 16 '12 14:12 gsakkis

It still doesn't work. This is what I call:

#For some reason, this doesn't seem to work, though it should.'''
# conn.indices.optimize(indices=index, wait_for_merge=True, max_num_segments=1)

try:
    r = http.request('GET', 'http://' + ESHOST + ':' + ESPORT + '/' + index + '/_optimize?max_num_segments=1')
except Exception, e:
    logger.error("Unable to connect to URL http://" + ESHOST + ":" + ESPORT + "/_optimize?max_num_segments=1 " + str(e))

untergeek avatar Dec 19 '12 19:12 untergeek

I pushed a small fix in case the optimize request parameters are case-sensitive though I can't really reproduce the problem before or after the fix. If it still doesn't work for you, can you post a self-contained test case?

gsakkis avatar Dec 20 '12 18:12 gsakkis