(writer, segments)
return []
This policy merges all existing segments.
This policy merges all existing segments.
This policy merges all existing segments .
def OPTIMIZE(writer, segments):
    """This policy merges all existing segments.
    """

    from whoosh.reading import SegmentReader

    for seg in segments:
        reader = SegmentReader(writer.storage, writer.schema, seg)
        writer.add_reader(reader)
        reader.close()
    return []
def OPTIMIZE ( writer , segments ) : from whoosh . reading import SegmentReader for seg in segments : reader = SegmentReader ( writer . storage , writer . schema , seg ) writer . add_reader ( reader ) reader . close ( ) return [ ]