Search Sync Python Module

Sync the database to elasticsearch index for use by Searching tools.

pacifica.policy.search_sync.create_worker_threads(threads, work_queue)[source]

Create the worker threads and return the list.

pacifica.policy.search_sync.es_client()[source]

Get the elasticsearch client object.

pacifica.policy.search_sync.generate_work(items_per_page, work_queue, time_ago)[source]

Generate the work from the db and send it to the work queue.

pacifica.policy.search_sync.search_sync(args)[source]

Main search sync subcommand.

pacifica.policy.search_sync.start_work(work_queue)[source]

The main thread for the work.

pacifica.policy.search_sync.try_doing_work(cli, job)[source]

Try doing some work even if you fail.

pacifica.policy.search_sync.try_es_connect(attempts=0)[source]

Recursively try to connect to elasticsearch.

pacifica.policy.search_sync.yield_data(obj, time_field, page, items_per_page, time_delta)[source]

yield objects from obj for bulk ingest.