def main(): """ The main function, do not change any code here """ es = Elasticsearch() ic = IndicesClient(es) a4.create_wikipedia_index(ic) a4.load_data(es) print(count_documents(es), "documents loaded")
def main(): """ The main function, do not change any code here """ es = Elasticsearch() ic = IndicesClient(es) a4.create_wikipedia_index(ic) a4.load_data(es) print("The top ranked title:", search_and_rank(es)) add_synonyms_to_index(ic) print("The top ranked title:", search_and_rank(es)) print(how_does_rank_work())
def main(): """ The main function, do not change any code here """ es = Elasticsearch() ic = IndicesClient(es) a4.create_wikipedia_index(ic) a4.load_data(es) print( f"There are {filter(es)['hits']['total']['value']} documents contains 'lake' or 'tour'" ) print( f"There are {search_without_improvement(es)['hits']['total']['value']} documents contains" " 'lake' or 'tour', but without the 'improvement required' sentense.")