Skip to content

Commit b123100

Browse files
author
MartinMikita
committed
Changed websearch API, working with extended match mode, added filtering and proper sort. Changed returned JSON format.
Filtering by columns: class, type, street, city, county, state, country_code, country. Filtering with viewbox - lon/lat inside bounding box (not west,south,east,north columns). Changed answer.html - display_name, rank and importance. (#6)
1 parent 6ef0952 commit b123100

File tree

2 files changed

+191
-172
lines changed

2 files changed

+191
-172
lines changed

web/templates/answer.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
33
{% block result %}
44
<hr>
55
{% if rc %}
6-
<p>Found <b>{{ result | length }}</b> results for <i>{{query}}</i> in <i>{{index}}</i>:</p>
6+
<p>Found <b>{{ result['totalResults'] }}</b> results for <i>{{query}}</i> in <i>{{index}}</i>:</p>
7+
<p>Showing <b>{{ result['results'] | length }}</b> results</p>
78
<table class="entries" width="100%" border="1" style="border-collapse: collapse;">
89
<tr>
910
<th></th>
11+
<th>id</th>
1012
<th>name</th>
1113
<th>class</th>
1214
<th>type</th>
1315
<th>bounding box</th>
14-
<th>lat, lon</th>
16+
<th>display_name</th>
17+
<th>rank</th>
18+
<th>importance</th>
1519
</tr>
16-
{% for row in result %}
20+
{% for row in result['results'] %}
1721
<tr>
1822
<td>{{ loop.index }}</td>
19-
{% for col in ('name', 'class', 'type', 'bbox', 'latlon') %}
23+
{% for col in ('id', 'name', 'class', 'type', 'boundingbox', 'display_name', 'rank', 'importance') %}
2024
<td>
2125
{% if col in row %}
2226
{{ row[col] }}

0 commit comments

Comments
 (0)