-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Story "Search page" and "Result Page" #284
Comments
Suggested Changes (Target Release Date: December 2017)
1A. These keyword search options should be global, rather than limited to the Historical Documents set. 1B. Remove "Refine Search" + related options from Historical Documents
3B. Create two groupings, labeled "From" and "To" 3B1. In the "From" grouping, include start date and start time 3B2. In the "To" grouping, include end date and end time 3C. Change "from start date" heading to:
3C. Add information icon (example image), which calls help/tips for entering dates:
3D. Add "Start Time" directly below "Start Date." Add data entry boxes for Hours (hh) and Minutes (mm) and a toggle for am and pm:
3E. Change "to end date" to:
3F. Add information icon (example image), which calls help/tips for entering dates:
3D. Add "End Time" directly below "End Date". Add data entry boxes for Hours (hh) and Minutes (mm) and a toggle for am and pm:
3G. Enable verification for data entry into "Start Date", "Start Time", "End Date", and "End Time". Example checks:
3H. Once the user has entered a viable "Start Date," auto-populate "End Date" with that user-entered "Start Date" value 3H1. The user should maintain ability to edit the value in both "Start Date" and "End Date" 3I. Add radio buttons for sorting results options:
Outstanding issue: Anniversary/omnis dies search |
Links from today's discussion:
|
@plutonik-a, Joe has reviewed the suggestions above and we made edits to the earlier version. Please feel free to act on these suggestions. |
@plutonik-a As promised, here is some sample text for your mockups of the results page: Filter by administration Given a search such as "cambodia AND domino" for the period 1954-1975, users may wish to further filter their results by individual volume or by administration grouping: Summary: 15 hits for search for "cambodia AND domino" between 1954-01-01T00:00:00Z and 1975-12-31T23:59:59Z
The query I wrote to produce these results in eXide (assuming a populated hsg-project) is: xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace frus="http://history.state.gov/frus/ns/1.0";
let $q := "cambodia AND domino"
let $start-date := xs:dateTime("1954-01-01T00:00:00Z")
let $end-date := xs:dateTime("1975-12-31T23:59:59Z")
let $hits := collection("/db/apps/frus/volumes")//tei:div[@type eq "document"][ft:query(., $q)][@frus:doc-dateTime-min ge $start-date and @frus:doc-dateTime-max le $end-date]
let $format :=
"markdown"
(:
"xml"
:)
let $admins := doc("/db/apps/frus/code-tables/administration-code-table.xml")
let $results :=
if ($format eq "xml") then
<hits>
<summary>{count($hits)} hits for search for "{$q}" between {$start-date} and {$end-date}</summary>
{
for $hit in $hits
let $vol-id := $hit/ancestor::tei:TEI/@xml:id
group by $admin-id := collection("/db/apps/frus/bibliography")/volume[@id eq $vol-id]/administration[1]
let $admin-label := $admins//item[value eq $admin-id]/label
order by index-of($admins//value, $admin-id)
return
<administration id="{$admin-id}">
<name>{$admin-label/string()} Administration ({count($hit)})</name>
{
for $h in $hit
group by $v-id := $h/ancestor::tei:TEI/@xml:id
let $bib := collection("/db/apps/frus/bibliography")/volume[@id eq $v-id]
let $title := string-join(($bib/title[@type eq "sub-series"], $bib/title[@type eq "volume-number"], $bib/title[@type eq "volume"]), ", ")
order by $v-id
return
<volume id="{$v-id}">{$title} ({count($h)})</volume>
}
</administration>
}
</hits>
else
``[*Summary: `{count($hits)}` hits for search for "`{$q}`" between `{$start-date}` and `{$end-date}`*
`{
for $hit in $hits
let $vol-id := $hit/ancestor::tei:TEI/@xml:id
group by $admin-id := collection("/db/apps/frus/bibliography")/volume[@id eq $vol-id]/administration[1]
let $admin-label := $admins//item[value eq $admin-id]/label
order by index-of($admins//value, $admin-id)
return
``[- [ ] [`{$admin-label}` Administration](?admin=`{$admin-id}`) (`{count($hit)}`)
`{
for $h in $hit
group by $v-id := $h/ancestor::tei:TEI/@xml:id
let $bib := collection("/db/apps/frus/bibliography")/volume[@id eq $v-id]
let $title := string-join(($bib/title[@type eq "sub-series"], $bib/title[@type eq "volume-number"], $bib/title[@type eq "volume"]), ", ")
order by $v-id
return
``[ - [ ] [`{$title}`](?volume-id=`{$v-id}`) (`{count($h)}`)
]``}`]``}`]``
return
if ($format = "markdown") then string-join($results, "") else $results Next up will be a similar entry relating to "tags". |
Here is a similar example for use in a mockup of a faceted filter of search results on "volume-level subject tags": 15 hits from 11 volumes covering 123 subjects for search for "cambodia AND domino" between 1954-01-01T00:00:00Z and 1975-12-31T23:59:59Z. Filter results by volume-level subject tags.
Here's the query I developed to produce these results: xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace frus="http://history.state.gov/frus/ns/1.0";
let $q := "cambodia AND domino"
let $start-date := xs:dateTime("1954-01-01T00:00:00Z")
let $end-date := xs:dateTime("1975-12-31T23:59:59Z")
let $format :=
"markdown"
(:
"xml"
:)
let $hits := collection("/db/apps/frus/volumes")//tei:div[@type eq "document"][ft:query(., $q)][@frus:doc-dateTime-min ge $start-date and @frus:doc-dateTime-max le $end-date]
let $vol-tags-map :=
for $hit in $hits
group by $vol-id := $hit/ancestor::tei:TEI/@xml:id
let $link := "https://history.state.gov/historicaldocuments/" || $vol-id
let $tag-ids := collection("/db/apps/tags/tagged-resources/frus")//study[link eq $link]//tag/@id/string()
return
map {
"vol-id": $vol-id,
"hits": count($hit),
"tag-ids": $tag-ids
}
let $tags-hit-map :=
for $tag-id in distinct-values($vol-tags-map?tag-ids)
let $hit-count := sum($vol-tags-map[?tag-ids = $tag-id]?hits)
let $tag-label := doc("/db/apps/tags/taxonomy/taxonomy.xml")//id[. eq $tag-id]/../label/string()
return
map {
"tag-id": $tag-id,
"tag-label": $tag-label,
"hit-count": $hit-count
}
return
if ($format = "xml") then
<results>
<summary>{count($hits)} hits from {count($vol-tags-map)} volumes covering {count($tags-hit-map)} subjects for search for "{$q}" between {$start-date} and {$end-date}. Filter results by volume-level subject tags.</summary>
{
for $map in $tags-hit-map
order by $map?tag-id
return
<tag id="{$map?tag-id}">{$map?tag-label} ({$map?hit-count})</tag>
}
</results>
else
``[*`{count($hits)}` hits from `{count($vol-tags-map)}` volumes covering `{count($tags-hit-map)}` subjects for search for "`{$q}`" between `{$start-date}` and `{$end-date}`. Filter results by volume-level subject tags.*
`{
for $map in $tags-hit-map
order by $map?tag-id
return
``[- [ ] [`{$map?tag-label}`](?tag-id=`{$map?tag-id}`) (`{$map?hit-count}`)
]``}`]`` |
We also discussed the idea of a timeline. Here's a similar query which produces the data in the format that we could feed into a timeline-oriented graphing tool such as dygraphs. First the results: {
"summary" : "15 hits for search for cambodia AND domino between 1954-01-01T00:00:00Z and 1975-12-31T23:59:59Z, grouped by year between 1954 and 1975",
"datapoints" : {
"1954" : 1,
"1964" : 4,
"1965" : 1,
"1966" : 1,
"1969" : 1,
"1970" : 2,
"1972" : 2,
"1975" : 3
}
} xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace frus="http://history.state.gov/frus/ns/1.0";
let $q := "cambodia AND domino"
let $start-date := xs:dateTime("1954-01-01T00:00:00Z")
let $end-date := xs:dateTime("1975-12-31T23:59:59Z")
let $hits := collection("/db/apps/frus/volumes")//tei:div[@type eq "document"][ft:query(., $q)][@frus:doc-dateTime-min ge $start-date and @frus:doc-dateTime-max le $end-date]
let $duration := $end-date - $start-date
let $resolution := if ($duration gt xs:dayTimeDuration("P365D")) then "year" else "TODO"
let $start := if ($resolution eq "year") then year-from-dateTime($start-date) else "TODO"
let $end := if ($resolution eq "year") then year-from-dateTime($end-date) else "TODO"
let $group-by := if ($resolution eq "year") then year-from-dateTime#1 else "TODO"
let $summary := count($hits) || " hits for search for " || $q || " between " || $start-date || " and " || $end-date || ", grouped by " || $resolution || " between " || $start || " and " || $end
let $results :=
map {
"summary": $summary,
"datapoints":
map:merge(
for $hit in $hits
group by $unit := $group-by($hit/@frus:doc-dateTime-min)
order by $unit
return
map:entry($unit, count($hit))
)
}
return
$results |
Some other bits of information from our discussion: Analytics insights
|
Thanks @WaxCylinderRevival for your comments and wordings and @joe for listing all filter options for the result page! Here are my suggestions for the search page containing the new requirements. About the date inputs: I haven't considered the "Anniversary/omnis dies search" in the mockup, because I'm not sure, if this shouldn't be rather a filter option for the results page? |
Many thanks @plutonik-a for new mockups in such a short time! I particularly like the tabs for Entire site/Selected resources as they make it very clear it's mutually exclusive alternative. Date filtering section looks very neat now too. Only the date picker is a tricky thing since US readers have much different habits for entering dates than Europeans. Not sure if we should be terribly worried about it but something to consider, certainly. The last section, grouping sort options and other preferences is something that only affects a small number of queries, thus perhaps could be hidden from sight at first and only open up (accordion style) after click? I was thinking of giving it a label of 'advanced search settings' or similar. |
@magda Sorting results could also go into the results page, but frankly, I don't see a problem in having those "refine" and and "sort" options on the main search page already expanded, because there is enough space and tidiness in the default view now. Why should users perform an extra click when there is no actual need for it? |
@joe @WaxCylinderRevival @tuurma
I have left the "refine search" option on the results page, because I think it is important to let the user perform a further (another) search from this page right away. |
@plutonik-a @tuurma Thank you again for the updated mockups. Talking with you and discussing these mockups was a valuable exercise that helped us work through the design and the implications of different choices. We have arrived at a simplified design that we think will achieve our core goals, of (1) prominently exposing users to our new date search feature and (2) elegantly accommodating future expansion of search features. To start from the basics, we need two pages:
Here are the components of each page: Search landing pageOverview: This page is laid out much like the current Search page on the site, except the "Select volumes" link (and the page it links to) is removed. This design also includes no tabs or accordions to expose section-specific options. We worried that the accordion design, while nice, buried the new dates feature and wouldn't be easily discovered. The primary change is the display of the date search fields by default.
(Note that no "Save search" box will appear. We will consider adding this in a future revision.) Search results pageOverview: This page is styled much like Alex's most recent results page. The "Keyword search" and "Date search" fieldsets are placed the top, search results appear in the body, and filters appear in a left sidebar. If a search mixes Historical Documents with other sections and results are sorted chronologically, the non-Historical Documents results will be be ordered after the dated results.
In a future expansion of the search results page, we expect to add filters (e.g., People, Places, Topics, Periods, etc.). But as @tuurma proposes, we'll initiate another issue for that request, which will start with another round of mockups. For now, we propose the features above for the December launch. I hope this is a clear description. Please let me know if you have any questions, and what you think. |
@joewiz @WaxCylinderRevival @tuurma Please take a review and let me know, if this mockup suits your ideas. A mockup for this iteration's result page will follow. |
@joe @WaxCylinderRevival
|
@plutonik-a Thanks for this very nice updated mockup of the search landing page and questions. First, regarding the mockup:
Second, regarding your questions:
|
Thanks @joewiz for answering my questions. The updated result page mockup will follow shortly. |
@plutonik-a, thank you for your speedy adjustments! The revised mock-up looks attractive and highly functional. |
@joewiz @WaxCylinderRevival Here are the mockups for the results page:
|
@joewiz About the volumes: I've found 4 types of volume titles, which contents can be nested in sublists. But I am not sure, if the narrow sidebar is the right element to display the very long volume titles. If we cut them off, some might seem to be identical...what do you think?
|
Add accessibility features to search bars.
@plutonik-a Thank you for the most recent mockups, questions, and split-out issues. First, to answer your questions:
xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare function local:trim-words($string as xs:string, $number as xs:integer) {
let $words := tokenize($string, "\s")
return
if (count($words) gt $number) then
(
subsequence($words, 1, ceiling($number div 2)) => string-join(" ")
, "…"
, $words[position() ge last() - floor($number div 2) + 1] => string-join(" ")
)
=> string-join()
else
$string
};
element volumes {
let $vols-in-db := collection("/db/apps/frus/volumes")/tei:TEI[.//tei:body/tei:div]/@xml:id
let $vols := collection("/db/apps/frus/bibliography")/volume[@id = $vols-in-db]
for $vol in $vols
let $vol-id := $vol/@id
let $title :=
($vol/title[@type eq "sub-series"], $vol/title[@type eq "volume-number"], $vol/title[@type eq "volume"])[. ne ""]
=> string-join(", ")
=> normalize-space()
=> local:trim-words(10)
order by $vol-id
return
element volume { attribute id { $vol-id }, $title }
} The first few results of this query are: <volumes>
<volume id="frus1865p4">1865, Part IV, Accompanying the…and Sympathy Inspired by These Events</volume>
<volume id="frus1912">1912, With the Annual Message…Transmitted to Congress December 3, 1912</volume>
<volume id="frus1913">1913, With the Address of…President to Congress December 2, 1913</volume>
<!-- snip -->
</volumes> Besides my notes that I've added to individual issues I just have a few comments: Search landing page
Search results page
(I've pasted this into #291 (comment).)
For reference, please see the left sidebar in https://www.loc.gov/search/?q=russia:
|
…AtState/hsg-shell into feat-advanced-search-284 * 'feat-advanced-search-284' of https://github.com/HistoryAtState/hsg-shell: refactor(search) further parametrize checkbox templates fix(search) add correct template call to search landing page refactor: modularize filter checklists; affects #284, #292
Search Landing Page
Parameters:
/search
or/search?q=
(shown if no non-empty query parameters are present)Search Result Page
Parameters:
/search?q=cambodia
or/search?within=documents&date-start=1965&date-end=1969
(shown if non-empty query parameters are present)Attached tasks:
The text was updated successfully, but these errors were encountered: