(dirname=None, indexname=None)
Prints information on the index.
Prints information on the index.
Prints information on the index .
def print_info(dirname=None, indexname=None):
    """
    Prints information on the index.
    """
    dirname = dirname or settings.INDEX_DIR
    indexname = indexname or settings.INDEX_NAME
    ix = init_index(dirname=dirname, indexname=indexname)

    counter = defaultdict(int)
    for index, fields in enumerate(ix.searcher().all_stored_fields()):
        key = fields['type_display']
        counter[key] += 1

    total = 0
    print('-' * 20)
    for key, value in counter.items():
        total += value
        print(f"{value}\t{key}")
    print('-' * 20)
    print(f"{total} total posts")
def print_info ( dirname = None , indexname = None ) : dirname = dirname or settings . INDEX_DIR indexname = indexname or settings . INDEX_NAME ix = init_index ( dirname = dirname , indexname = indexname ) counter = defaultdict ( int ) for index , fields in enumerate ( ix . searcher ( ) . all_stored_fields ( ) ) : key = fields [ 'type_display' ] counter [ key ] += 1 total = 0 print ( '-' * 20 ) for key , value in counter . items ( ) : total += value print ( f"{value}\t{key}" ) print ( '-' * 20 ) print ( f"{total} total posts" )