Explorar el Código

adding total number to search page

solr_update
Simon Bowie hace 2 años
padre
commit
7053f395e1
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. +2
    -1
      web/app/search.py
  2. +1
    -1
      web/app/templates/search.html

+ 2
- 1
web/app/search.py Ver fichero

@@ -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 Ver fichero

@@ -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>


Cargando…
Cancelar
Guardar