search

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category added in v1.9.3

type Category struct {
	Count           int           `json:"count"`
	LocaliseKeyName string        `json:"localise_key"`
	ContentTypes    []ContentType `json:"content_types"`
}

Category represents all the search categories in search page

type Contact added in v1.6.1

type Contact struct {
	Name      string `json:"name"`
	Telephone string `json:"telephone,omitempty"`
	Email     string `json:"email"`
}

Contact represents each search result contact details

type ContentItem added in v1.6.1

type ContentItem struct {
	Description Description `json:"description"`
	Type        string      `json:"type"`
	URI         string      `json:"uri"`
	Matches     *Matches    `json:"matches,omitempty"`
}

ContentItem represents each search result

type ContentType added in v1.6.1

type ContentType struct {
	Type            string `json:"type"`
	Count           int    `json:"count"`
	LocaliseKeyName string `json:"localise_key"`
}

ContentType represents the type of the search results and the number of results for each type

type Department added in v1.11.1

type Department struct {
	Name  string `json:"name"`
	URL   string `json:"url"`
	Code  string `json:"code"`
	Match string `json:"match"`
}

Department represents other gov departmetns that match the search term

type Description added in v1.6.1

type Description struct {
	Contact           *Contact  `json:"contact,omitempty"`
	DatasetID         string    `json:"dataset_id,omitempty"`
	Edition           string    `json:"edition,omitempty"`
	Headline1         string    `json:"headline1,omitempty"`
	Headline2         string    `json:"headline2,omitempty"`
	Headline3         string    `json:"headline3,omitempty"`
	Keywords          *[]string `json:"keywords,omitempty"`
	LatestRelease     *bool     `json:"latest_release,omitempty"`
	Language          string    `json:"language,omitempty"`
	MetaDescription   string    `json:"meta_description,omitempty"`
	NationalStatistic *bool     `json:"national_statistic,omitempty"`
	NextRelease       string    `json:"next_release,omitempty"`
	PreUnit           string    `json:"pre_unit,omitempty"`
	ReleaseDate       string    `json:"release_date,omitempty"`
	Source            string    `json:"source,omitempty"`
	Summary           string    `json:"summary"`
	Title             string    `json:"title"`
	Unit              string    `json:"unit,omitempty"`
}

Description represents each search result description

type MatchDescription added in v1.6.2

type MatchDescription struct {
	Summary         *[]MatchDetails `json:"summary"`
	Title           *[]MatchDetails `json:"title"`
	Edition         *[]MatchDetails `json:"edition,omitempty"`
	MetaDescription *[]MatchDetails `json:"meta_description,omitempty"`
	Keywords        *[]MatchDetails `json:"keywords,omitempty"`
	DatasetID       *[]MatchDetails `json:"dataset_id,omitempty"`
}

MatchDescription represents each search result matches' description

type MatchDetails added in v1.6.1

type MatchDetails struct {
	Value string `json:"value,omitempty"`
	Start int    `json:"start"`
	End   int    `json:"end"`
}

MatchDetails represents each search result matches' details

type Matches added in v1.6.1

type Matches struct {
	Description MatchDescription `json:"description"`
}

Matches represents each search result matches

type Page

type Page struct {
	model.Page
	Data       Search      `json:"data"`
	Department *Department `json:"department"`
}

Page represents the search page

type Response

type Response struct {
	Count       int           `json:"count"`
	Categories  []Category    `json:"categories"`
	Items       []ContentItem `json:"items"`
	Suggestions []string      `json:"suggestions,omitempty"`
}

Response represents the search results

type Search struct {
	Query      string           `json:"query"`
	Filter     []string         `json:"filter,omitempty"`
	Sort       Sort             `json:"sort,omitempty"`
	Pagination model.Pagination `json:"pagination,omitempty"`
	Response   Response         `json:"response"`
}

Search represents all search parameters and response data of the search

type Sort added in v1.9.3

type Sort struct {
	Query              string        `json:"query,omitempty"`
	LocaliseFilterKeys []string      `json:"filter_text,omitempty"`
	LocaliseSortKey    string        `json:"sort_text,omitempty"`
	Options            []SortOptions `json:"options,omitempty"`
}

Sort represents all the information of sorting related to the search page

type SortOptions added in v1.9.6

type SortOptions struct {
	Query           string `json:"query,omitempty"`
	LocaliseKeyName string `json:"localise_key"`
}

SortOptions represents all the information of different sorts available

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL