Browse Source

adding total number to search page

solr_update
Simon Bowie 2 years ago
parent
commit
7053f395e1
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      web/app/search.py
  2. +1
    -1
      web/app/templates/search.html

+ 2
- 1
web/app/search.py View File

search_results = solr.solr_search(core, sort, search) search_results = solr.solr_search(core, sort, search)
results = search_results[0] results = search_results[0]
num_found = search_results[1] num_found = search_results[1]
return render_template('search.html', results=results, num_found=num_found, search=search, core=core, sort=sort)
total_number = solr.get_total_number(core)
return render_template('search.html', results=results, num_found=num_found, total_number=total_number, search=search, core=core, sort=sort)
else: else:
return redirect(url_for('main.index')) return redirect(url_for('main.index'))



+ 1
- 1
web/app/templates/search.html View File

<div class="col m-5"> <div class="col m-5">
<a href="{{ url_for('main.index') }}" class="h1 text-left"> ⇽ </a> <a href="{{ url_for('main.index') }}" class="h1 text-left"> ⇽ </a>
<p class="h1 text-center">a timeline of inventions</p> <p class="h1 text-center">a timeline of inventions</p>
<p class="mt-2 text-center">{{ num_found }} patents found out of 320,000</p>
<p class="mt-2 text-center">{{ num_found }} patents found out of {{ total_number }}</p>
</div> </div>
</div> </div>



Loading…
Cancel
Save