Skip to content

Commit 010b38b

Browse files
authored
Add a details component with search query tips (#293)
Provide some query examples highlighting some of the supported syntax, and link to the full documentation in Datahub. This should help mitigate the sometimes unintuitive default behaviour of requiring that ALL search terms match. This behaviour is how Datahub have configured search, and to change it we would have to customise the Elasticsearch query.
1 parent daacfdb commit 010b38b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

templates/search.html

+16
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ <h1 class="govuk-heading-l">{{h1_value}}</h1>
2121
</div>
2222
</div>
2323
</form>
24+
<details class="govuk-details">
25+
<summary class="govuk-details__summary">
26+
<span class="govuk-details__summary-text">
27+
Search query tips
28+
</span>
29+
</summary>
30+
<div class="govuk-details__text">
31+
<ul class="govuk-list govuk-list--bullet">
32+
<li><p>Use multiple words to narrow down your search.</p><p>For example: <strong>prisons probation</strong> matches data mentioning "prisons" AND "probation".</p></li>
33+
<li><p>Separate words with a pipe to broaden your search.</p><p>For example: <strong>prisons | probation</strong> matches data mentioning "prisons" OR "probation".</p></li>
34+
<li><p>Quote phrases to require an exact match.</p><p>For example: <strong>"case management"</strong> matches the exact phrase "case management" but not either word on its own.</p></li>
35+
<li><p>Use a minus sign to exclude words.</p><p>For example: <strong>courts -magistrates</strong> excludes any results that mention "magistrates".</p></li>
36+
</ul>
37+
<p><a href="https://datahubproject.io/docs/how/search/#advanced-queries">More search query examples</a></p>
38+
</div>
39+
</details>
2440
</div>
2541
</div>
2642
<div class="govuk-grid-row">

0 commit comments

Comments
 (0)