Skip to content

Maintenance

merge(config)

Perform a force merge on each view's indices.

This cleans up deleted documents etc.

Source code in dataimporter/cli/maintenance.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@maintenance_group.command('merge')
@with_config()
def merge(config: Config):
    """
    Perform a force merge on each view's indices.

    This cleans up deleted documents etc.
    """
    with use_importer(config) as importer:
        for view in importer.views:
            if view.is_published:
                console.log(f'Force merge on {view.name} indices')
                importer.force_merge(view.name)
                console.log(f'{view.name} complete')

shell(config)

Drops the caller into a Python shell with a DataImporter object (importer) instance available, thus allowing direct access to all methods.

This is provided as purely a debugging tool, use at your own risk!

Source code in dataimporter/cli/maintenance.py
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@maintenance_group.command()
@with_config()
def shell(config: Config):
    """
    Drops the caller into a Python shell with a DataImporter object (`importer`)
    instance available, thus allowing direct access to all methods.

    This is provided as purely a debugging tool, use at your own risk!
    """
    with use_importer(config) as importer:
        console.print('Starting shell...')
        env = setup_env(importer)
        banner = f'Available variables/functions: {", ".join(env.keys())}'
        code.interact(banner=banner, local=env)