def construct_business_review_file(source_file_business, source_file_review, target_file_basic_name, target_file_number, index_name, type_name):
    business_map = get_business_map(source_file_business)
    business_review_map = get_business_review_map(source_file_review, business_map)
    business_review_map_with_avg_stars = add_avg_stars_in_business_review_map(business_review_map)
    business_review_map_with_diff = add_stars_reviews_diff_in_business_review_map(business_review_map_with_avg_stars)
    name_list = files_name_gen(target_file_basic_name, target_file_number)
    serialize_for_es(name_list, business_review_map_with_diff, index_name, type_name, 10000)

    name_list2 = files_name_gen("yelp_trend", 1)
    yelp_map = cal_yelp_trend(business_review_map_with_avg_stars)
    serialize_for_es(name_list2, yelp_map, "yelp", "yelp_trend", 100000)
Exemple #2
0
def construct_business_review_file(source_file_business, source_file_review,
                                   target_file_basic_name, target_file_number,
                                   index_name, type_name):
    business_map = get_business_map(source_file_business)
    business_review_map = get_business_review_map(source_file_review,
                                                  business_map)
    business_review_map_with_avg_stars = add_avg_stars_in_business_review_map(
        business_review_map)
    business_review_map_with_diff = add_stars_reviews_diff_in_business_review_map(
        business_review_map_with_avg_stars)
    name_list = files_name_gen(target_file_basic_name, target_file_number)
    serialize_for_es(name_list, business_review_map_with_diff, index_name,
                     type_name, 10000)

    name_list2 = files_name_gen("yelp_trend", 1)
    yelp_map = cal_yelp_trend(business_review_map_with_avg_stars)
    serialize_for_es(name_list2, yelp_map, "yelp", "yelp_trend", 100000)
Exemple #3
0
def construct_review_detail_file(source_file_review, target_file_basic_name, target_file_number, index_name, type_name):
    review_detail_map = get_review_detail_map(source_file_review)
    files_name_list = files_name_gen(target_file_basic_name, target_file_number)
    serialize_for_es(files_name_list, review_detail_map, index_name, type_name, 100000)