def CUSTOM_MERGE_SMALL(writer, segments):
    """This policy merges small segments, where "small" is defined using a
    fixed number of documents. Unlike whoosh.filedb.filewriting.MERGE_SMALL,
    this one does nothing unless there's more than one segment to merge.
    """
    from whoosh.filedb.filereading import SegmentReader
    unchanged_segments = []
    segments_to_merge = []
    for segment in segments:
        if segment.doc_count_all() < 10000:
            segments_to_merge.append(segment)
        else:
            unchanged_segments.append(segment)
    if len(segments_to_merge) > 1:
        for segment in segments_to_merge:
            with SegmentReader(writer.storage, writer.schema, segment
                ) as reader:
                writer.add_reader(reader)
    else:
        unchanged_segments.extend(segments_to_merge)
    return unchanged_segments
