'Tells Solr to streamline the number of segments used, essentially a
defragmentation operation.
Optionally accepts ``maxSegments``. Default is ``None``.
Optionally accepts ``waitFlush``. Default is ``None``.
Optionally accepts ``waitSearcher``. Default is ``None``.
Usage::
solr.optimize()'

def optimize(self, commit=True, waitFlush=None, waitSearcher=None, maxSegments=None, handler=u'update'):

    if maxSegments:
        msg = (u'<optimize    maxSegments="%d"    />' % maxSegments)
    else:
        msg = u'<optimize    />'
    return self._update(msg, commit=commit, waitFlush=waitFlush, waitSearcher=waitSearcher, handler=handler)
