{{ define "title" }}{{ with .QueryLabel }}{{ . }} - {{ end }}Search - Snowden Archive{{ end }} {{ define "search-result-item" }} {{ $r := .Result }}{{ $d := $r.Doc }} {{ $qs := "" }}{{ if eq $d.Collection "foia" }}{{ $qs = .FOIAQS }}{{ end }}
  • {{ if .ShowThumbs }} {{ end }}

    {{ $r.Title }} [pdf]

    {{ template "type-badge" $d.Type }} {{ if $d.Publication }} {{/* A year links to its publication-year page only when that page lists the document: the year of its FIRST publication. */}}
    {{- $shown := false -}} {{- range $pub := $d.Publication -}} {{- if $pub.Publisher -}} {{- if $shown }} · {{ end }}{{ $shown = true -}} {{ template "pub-publisher" (dict "Pub" $pub "QS" $qs) }} {{- if ge (len $pub.DatePublished) 4 }}{{ $y := slice $pub.DatePublished 0 4 }} {{ if eq $y $d.FirstPubYear }}{{ $y }}{{ else }}{{ $y }}{{ end }}{{ end -}} {{- range $j, $r := $pub.Journalists }}{{ if $j }}, {{ else }} - {{ end }}{{ $r }}{{ end -}} {{- end -}} {{- end }}
    {{ end }}
    {{ if $d.DocMeta.Creator }} {{ $d.DocMeta.Creator }} {{ end }} {{ if and $d.DocMeta.Creator $d.DocMeta.DateCreated }} · {{ end }} {{ if $d.DocMeta.DateCreated }} {{ if ge (len $d.DocMeta.DateCreated) 4 }} {{ $d.DocMeta.DateCreated }} {{ else }} {{ $d.DocMeta.DateCreated }} {{ end }} {{ end }} {{ if $d.DocMeta.Programs }} · {{ $progs := $d.DocMeta.Programs }} {{ $shown := $progs }}{{ if gt (len $progs) 8 }}{{ $shown = slice $progs 0 8 }}{{ end }} {{ facetLinks (dict "Vals" $shown "Cat" "program" "Sep" "dot" "Class" "meta-link-soft" "QS" $qs) }} {{ if gt (len $progs) 8 }}+{{ add (len $progs) -8 }} more{{ end }} {{ end }}
    {{ $r.Desc }}
    {{ range $r.Snippets }}
    {{ . }}
    {{ end }} {{ range $r.VersionSnippets }}
    Copy: {{ .Label }} {{ .HTML }}
    {{ end }} {{ with $r.MatchesIn }}
    Matches in: {{- range $i, $v := . }}{{ if $i }},{{ end }} {{ $v.Label }}{{ end }}
    {{ end }}
  • {{ end }} {{ define "content" }}

    Search

    Search syntax help

    Ways to write a value, in any row or after any operator:

    The simple search box (on home page, on 404 page, and via URL ?q=) understands field operators:

    {{ range $i, $val := .Queries }}
    {{ if eq $i 0 }} Find {{ else }} {{ end }}
    in {{ $fi := index $.Fields $i }}
    {{ if ne $i 0 }} {{ else }} {{ end }}
    {{ end }}
    {{ if lt (len .Queries) .ClauseLimit }} {{ else }} {{ .ClauseLimit }} rows is the most a search can have {{ end }}
    {{ $hasDates := or .DateDocStart .DateDocEnd .DatePubStart .DatePubEnd }} {{ $hasFilters := or $hasDates .CollFiltered }}
    Filters{{ if $hasFilters }} (active){{ end }}
    Collections
    Doc date to
    Published to
    Reset
    {{ if .RecentSearches }}
    Recent searches ({{ len .RecentSearches }})
    {{ range .RecentSearches }}{{ .Label }}{{ end }}
    {{ end }}
    {{ if .OverClauses }}

    Search not run: it has {{ .OverClauses }} parts - rows, or the field:, “quoted” and -excluded terms of a typed query - and a search can have at most {{ .ClauseLimit }}. The form above keeps the first {{ .ClauseLimit }}; the rest, including any exclusions at the end, were left out. Check the rows and search again.

    {{ else if .OverWords }}

    Search not run: it has {{ .OverWords }} words, counting the words of “quoted” phrases and -excluded terms, and a search can have at most {{ .WordLimit }}. Shorten it and search again.

    {{ end }} {{ if .Searched }} {{ if gt (len .SearchTypeCounts) 1 }}{{ template "type-filter" (dict "Action" "/search" "Params" .FormParams "AllTypes" .SearchTypeCounts "SelectedTypes" .SelTypeSet) }}{{ end }}

    {{ .Total }} result{{ if ne .Total 1 }}s{{ end }}

    {{ template "sort-bar" (dict "SortURL" .SearchBaseURL "SortBy" .Sort "Order" .Order "ShowRelevance" true "DefaultSort" "relevance") }} {{ if .Savable }}
    {{ end }}
    {{ if gt (len .DateHist) 1 }}
    {{ range .DateHist }} {{ if .URL }} {{ .Count }} {{ .Year }} {{ else }} {{ .Count }} {{ .Year }} {{ end }} {{ end }}
    {{ end }} {{ if .Results }} {{ if .Facets }}
    Refine results
    {{ range .Facets }}
    {{ .Label }} {{ range .Values }}{{ .Name }}{{ .Count }}{{ end }}
    {{ end }}
    {{ end }} {{ if .SnippetsCapped }}

    Text snippets are shown for the first {{ .SnippetLimit }} results on this page - choose a page size in preferences, or narrow the search, to see snippets for the rest.

    {{ end }} {{ template "pagination" (dict "Page" .Page "TotalPages" .TotalPages "BaseURL" .SearchBaseURL "Sort" .Sort "Order" .Order) }} {{ else }}

    No matches found.

    {{ end }} {{ end }} {{ end }} {{ template "base.html" . }}