Parcourir la source

adding total number to search page

solr_update
Simon Bowie il y a 2 ans
Parent
révision
7053f395e1
2 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. +2
    -1
      web/app/search.py
  2. +1
    -1
      web/app/templates/search.html

+ 2
- 1
web/app/search.py Voir le fichier

@@ -28,7 +28,8 @@ def basic_search():
search_results = solr.solr_search(core, sort, search)
results = search_results[0]
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:
return redirect(url_for('main.index'))


+ 1
- 1
web/app/templates/search.html Voir le fichier

@@ -6,7 +6,7 @@
<div class="col m-5">
<a href="{{ url_for('main.index') }}" class="h1 text-left"> ⇽ </a>
<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>


Chargement…
Annuler
Enregistrer