text = f.read() | text = f.read() | ||||
text = markdown.markdown(text) | text = markdown.markdown(text) | ||||
core = 'active' | |||||
results_list = [] | |||||
i = 0 | |||||
while i <= 9: | |||||
search_results = solr.random_search(core) | |||||
results = search_results[0] | |||||
for result in results: | |||||
results_list.append(result) | |||||
i += 1 | |||||
results = solr.get_number_random_records('active', 10) | |||||
return render_template('theme.html', text=text, results=results_list) | |||||
return render_template('theme.html', text=text, results=results) |
return output | return output | ||||
def get_number_random_records(core, number): | |||||
results_list = [] | |||||
i = 0 | |||||
while i <= number-1: | |||||
search_results = random_search(core) | |||||
results = search_results[0] | |||||
for result in results: | |||||
results_list.append(result) | |||||
i += 1 | |||||
return results_list | |||||
def get_ten_random_elements(field): | def get_ten_random_elements(field): | ||||
core = 'all' | core = 'all' | ||||
output = [] | output = [] |