(pillow_id='CaseSearchToElasticsearchPillow', num_processes=1,
                                            process_num=0, **kwargs)
return ConstructedPillow(
        name=pillow_id,
        checkpoint=checkpoint,
        change_feed=change_feed,
        processor=case_processor,
        change_processed_event_handler=KafkaCheckpointEventHandler(
            checkpoint=checkpoint, checkpoint_frequency=100, change_feed=change_feed,
        ),
    )
Populates the `case search` Elasticsearch index.

        Processors:
          - :py:class:`corehq.pillows.case_search.CaseSearchPillowProcessor`
Populates the `case search` Elasticsearch index.
Populates the case search Elasticsearch index .
def get_case_search_to_elasticsearch_pillow(pillow_id='CaseSearchToElasticsearchPillow', num_processes=1,
                                            process_num=0, **kwargs):
    """Populates the `case search` Elasticsearch index.

        Processors:
          - :py:class:`corehq.pillows.case_search.CaseSearchPillowProcessor`
    """
    index_info = CASE_SEARCH_INDEX_INFO
    if 'index_name' in kwargs and 'index_alias' in kwargs:
        # Allow overriding index name and alias for the purposes of reindexing.
        # These can be set in localsettings.LOCAL_PILLOWTOPS
        raw_info = CASE_SEARCH_INDEX_INFO.to_json()
        raw_info.pop("meta")
        index_info = ElasticsearchIndexInfo.wrap(raw_info)
        index_info.index = kwargs['index_name']
        index_info.alias = kwargs['index_alias']

    checkpoint = get_checkpoint_for_elasticsearch_pillow(pillow_id, index_info, topics.CASE_TOPICS)
    case_processor = CaseSearchPillowProcessor(
        elasticsearch=get_es_new(),
        index_info=index_info,
        doc_prep_fn=transform_case_for_elasticsearch
    )
    change_feed = KafkaChangeFeed(
        topics=topics.CASE_TOPICS, client_id='cases-to-es', num_processes=num_processes, process_num=process_num
    )
    return ConstructedPillow(
        name=pillow_id,
        checkpoint=checkpoint,
        change_feed=change_feed,
        processor=case_processor,
        change_processed_event_handler=KafkaCheckpointEventHandler(
            checkpoint=checkpoint, checkpoint_frequency=100, change_feed=change_feed,
        ),
    )
def get_case_search_to_elasticsearch_pillow ( pillow_id = 'CaseSearchToElasticsearchPillow' , num_processes = 1 , process_num = 0 , * * kwargs ) : index_info = CASE_SEARCH_INDEX_INFO if 'index_name' in kwargs and 'index_alias' in kwargs : # Allow overriding index name and alias for the purposes of reindexing. # These can be set in localsettings.LOCAL_PILLOWTOPS raw_info = CASE_SEARCH_INDEX_INFO . to_json ( ) raw_info . pop ( "meta" ) index_info = ElasticsearchIndexInfo . wrap ( raw_info ) index_info . index = kwargs [ 'index_name' ] index_info . alias = kwargs [ 'index_alias' ] checkpoint = get_checkpoint_for_elasticsearch_pillow ( pillow_id , index_info , topics . CASE_TOPICS ) case_processor = CaseSearchPillowProcessor ( elasticsearch = get_es_new ( ) , index_info = index_info , doc_prep_fn = transform_case_for_elasticsearch ) change_feed = KafkaChangeFeed ( topics = topics . CASE_TOPICS , client_id = 'cases-to-es' , num_processes = num_processes , process_num = process_num ) return ConstructedPillow ( name = pillow_id , checkpoint = checkpoint , change_feed = change_feed , processor = case_processor , change_processed_event_handler = KafkaCheckpointEventHandler ( checkpoint = checkpoint , checkpoint_frequency = 100 , change_feed = change_feed , ) , )