models

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentItemLegacy

type ContentItemLegacy struct {
	Description DescriptionLegacy `json:"description"`
	Type        string            `json:"type"`
	URI         string            `json:"uri"`
}

type CountValue added in v1.30.0

type CountValue struct {
	Value int `json:"value"`
}

type CreateIndexResponse added in v1.29.0

type CreateIndexResponse struct {
	IndexName string `json:"index_name"`
}

type DescriptionLegacy

type DescriptionLegacy struct {
	Contact           *contactLegacy      `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"`
	Highlight         *HighlightObjLegacy `json:"highlight,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"`
}

type ESBucket

type ESBucket struct {
	Key   string `json:"key"`
	Count int    `json:"doc_count"`
}

type ESBucketLegacy

type ESBucketLegacy struct {
	Key   string `json:"key"`
	Count int    `json:"doc_count"`
}

type ESDimensions added in v1.33.0

type ESDimensions struct {
	Name     string `json:"name"`
	Label    string `json:"label"`
	RawLabel string `json:"raw_label"`
}

type ESDocCounts

type ESDocCounts struct {
	Buckets []ESBucket `json:"buckets"`
}

type ESHighlight

type ESHighlight struct {
	Title     []*string `json:"title"`
	Edition   []*string `json:"edition"`
	Summary   []*string `json:"summary"`
	MetaDesc  []*string `json:"meta_description"`
	Keywords  []*string `json:"keywords"`
	DatasetID []*string `json:"dataset_id"`
}

type ESHighlightLegacy

type ESHighlightLegacy struct {
	DescriptionTitle     []*string `json:"description.title"`
	DescriptionEdition   []*string `json:"description.edition"`
	DescriptionSummary   []*string `json:"description.summary"`
	DescriptionMeta      []*string `json:"description.metaDescription"`
	DescriptionKeywords  []*string `json:"description.keywords"`
	DescriptionDatasetID []*string `json:"description.datasetId"`
}

type ESPopulationType added in v1.33.0

type ESPopulationType struct {
	Name  string `json:"name"`
	Label string `json:"label"`
}

type ESResponseAggregations

type ESResponseAggregations struct {
	ContentTypes       ESDocCounts `json:"content_types"`
	Topic              ESDocCounts `json:"topic"`
	PopulationType     ESDocCounts `json:"population_type"`
	Dimensions         ESDocCounts `json:"dimensions"`
	DistinctTopicCount CountValue  `json:"distinct_topics_count"`
}

type ESResponseAggregationsLegacy

type ESResponseAggregationsLegacy struct {
	DocCounts struct {
		Buckets []ESBucketLegacy `json:"buckets"`
	} `json:"docCounts"`
}

type ESResponseHit

type ESResponseHit struct {
	Source    ESSourceDocument `json:"_source"`
	Highlight *ESHighlight     `json:"highlight"`
}

type ESResponseHitLegacy

type ESResponseHitLegacy struct {
	Source    ESSourceDocumentLegacy `json:"_source"`
	Highlight ESHighlightLegacy      `json:"highlight"`
}

type ESResponseHits

type ESResponseHits struct {
	Total int
	Hits  []ESResponseHit `json:"hits"`
}

type ESResponseHitsLegacy

type ESResponseHitsLegacy struct {
	Total int
	Hits  []ESResponseHitLegacy `json:"hits"`
}

type ESResponseItemLegacy

type ESResponseItemLegacy struct {
	Took         int                          `json:"took"`
	Hits         ESResponseHitsLegacy         `json:"hits"`
	Aggregations ESResponseAggregationsLegacy `json:"aggregations"`
	Suggest      ESSuggestLegacy              `json:"suggest"`
}

type ESResponseLegacy

type ESResponseLegacy struct {
	Responses []ESResponseItemLegacy `json:"responses"`
}

type ESSearchSuggestLegacy

type ESSearchSuggestLegacy struct {
	Options []ESSearchSuggestOptionsLegacy `json:"options"`
}

type ESSearchSuggestOptionsLegacy

type ESSearchSuggestOptionsLegacy struct {
	Text string `json:"text"`
}

type ESSourceDocument

type ESSourceDocument struct {
	DataType        string              `json:"type"`
	CDID            string              `json:"cdid"`
	DatasetID       string              `json:"dataset_id"`
	Edition         string              `json:"edition"`
	Keywords        []string            `json:"keywords"`
	MetaDescription string              `json:"meta_description"`
	ReleaseDate     string              `json:"release_date,omitempty"`
	Summary         string              `json:"summary"`
	Title           string              `json:"title"`
	Topics          []string            `json:"topics"`
	URI             string              `json:"uri"`
	Highlight       *HighlightObj       `json:"highlight,omitempty"`
	DateChanges     []ReleaseDateChange `json:"date_changes,omitempty"`
	Cancelled       bool                `json:"cancelled,omitempty"`
	CanonicalTopic  string              `json:"canonical_topic"`
	Finalised       bool                `json:"finalised,omitempty"`
	ProvisionalDate string              `json:"provisional_date,omitempty"`
	Published       bool                `json:"published,omitempty"`
	Language        string              `json:"language,omitempty"`
	Survey          string              `json:"survey,omitempty"`
	PopulationType  ESPopulationType    `json:"population_type,omitempty"`
	Dimensions      []ESDimensions      `json:"dimensions,omitempty"`
}

type ESSourceDocumentLegacy

type ESSourceDocumentLegacy struct {
	Description struct {
		Summary           string         `json:"summary"`
		NextRelease       string         `json:"nextRelease,omitempty"`
		Unit              string         `json:"unit,omitempty"`
		Keywords          []*string      `json:"keywords,omitempty"`
		ReleaseDate       string         `json:"releaseDate,omitempty"`
		Edition           string         `json:"edition,omitempty"`
		LatestRelease     *bool          `json:"latestRelease,omitempty"`
		Language          string         `json:"language,omitempty"`
		Contact           *contactLegacy `json:"contact,omitempty"`
		DatasetID         string         `json:"datasetId,omitempty"`
		Source            string         `json:"source,omitempty"`
		Title             string         `json:"title"`
		MetaDescription   string         `json:"metaDescription,omitempty"`
		NationalStatistic *bool          `json:"nationalStatistic,omitempty"`
		PreUnit           string         `json:"preUnit,omitempty"`
		Headline1         string         `json:"headline1,omitempty"`
		Headline2         string         `json:"headline2,omitempty"`
		Headline3         string         `json:"headline3,omitempty"`
	} `json:"description"`
	Type string `json:"type"`
	URI  string `json:"uri"`
}

type ESSuggestLegacy

type ESSuggestLegacy struct {
	SearchSuggest []ESSearchSuggestLegacy `json:"search_suggest"`
}

type EsResponse

type EsResponse struct {
	Took         int                    `json:"took"`
	Hits         ESResponseHits         `json:"hits"`
	Aggregations ESResponseAggregations `json:"aggregations"`
	Suggest      Suggest                `json:"suggest"`
}

type EsResponses

type EsResponses struct {
	Responses []*EsResponse `json:"responses"`
}

EsResponse holds a response slice from ES

type FilterCount

type FilterCount struct {
	Type  string `json:"type"`
	Label string `json:"label"`
	Count int    `json:"count"`
}

FilterCount represents the API response for an aggregation

type HighlightObj

type HighlightObj struct {
	DatasetID       string    `json:"dataset_id,omitempty"`
	Keywords        []*string `json:"keywords,omitempty"`
	MetaDescription string    `json:"meta_description,omitempty"`
	Summary         string    `json:"summary,omitempty"`
	Title           string    `json:"title,omitempty"`
}

type HighlightObjLegacy

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

type Item added in v1.33.0

type Item struct {
	DataType        string              `json:"type"`
	CDID            string              `json:"cdid"`
	DatasetID       string              `json:"dataset_id"`
	Edition         string              `json:"edition"`
	Keywords        []string            `json:"keywords"`
	MetaDescription string              `json:"meta_description"`
	ReleaseDate     string              `json:"release_date,omitempty"`
	Summary         string              `json:"summary"`
	Title           string              `json:"title"`
	Topics          []string            `json:"topics"`
	URI             string              `json:"uri"`
	Highlight       *HighlightObj       `json:"highlight,omitempty"`
	DateChanges     []ReleaseDateChange `json:"date_changes,omitempty"`
	Cancelled       bool                `json:"cancelled,omitempty"`
	CanonicalTopic  string              `json:"canonical_topic"`
	Finalised       bool                `json:"finalised,omitempty"`
	ProvisionalDate string              `json:"provisional_date,omitempty"`
	Published       bool                `json:"published,omitempty"`
	Language        string              `json:"language,omitempty"`
	Survey          string              `json:"survey,omitempty"`
	PopulationType  string              `json:"population_type,omitempty"`
	Dimensions      []ESDimensions      `json:"dimensions,omitempty"`
}

type Option

type Option struct {
	Text  string  `json:"text"`
	Score float64 `json:"score"`
}

type ReleaseDateChange

type ReleaseDateChange struct {
	ChangeNotice string `json:"change_notice"`
	Date         string `json:"previous_date"`
}

ReleaseDateChange represent a date change of a release

type SearchResponse

type SearchResponse struct {
	Count               int           `json:"count"`
	Took                int           `json:"took"`
	DistinctItemsCount  int           `json:"distinct_items_count"`
	Topics              []FilterCount `json:"topics"`
	ContentTypes        []FilterCount `json:"content_types"`
	Items               []Item        `json:"items"`
	Suggestions         []string      `json:"suggestions,omitempty"`
	AdditionSuggestions []string      `json:"additional_suggestions,omitempty"`
	Dimensions          []FilterCount `json:"dimensions,omitempty"`
	PopulationType      []FilterCount `json:"population_type,omitempty"`
}

type SearchResponseLegacy

type SearchResponseLegacy struct {
	Count               int                 `json:"count"`
	Took                int                 `json:"took"`
	ContentTypes        []FilterCount       `json:"content_types"`
	Items               []ContentItemLegacy `json:"items"`
	Suggestions         []string            `json:"suggestions,omitempty"`
	AdditionSuggestions []string            `json:"additional_suggestions,omitempty"`
}

Structs representing the transformed response

type SearchSuggest

type SearchSuggest struct {
	Text    string   `json:"text"`
	Offset  int      `json:"offset"`
	Length  int      `json:"length"`
	Options []Option `json:"options"`
}

type Suggest

type Suggest struct {
	SearchSuggest []SearchSuggest `json:"search_suggest"`
}

Jump to

Keyboard shortcuts

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