schema

package
v0.0.0-...-c34d6d1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Title   string   `json:"title"`
	Link    string   `json:"link"`
	Content string   `json:"content"`
	Tags    []string `json:"tags"`
}

represents raw data that we will parse objects into before they have been transformed into records and stored in our database

func HandleYouTubeVideo

func HandleYouTubeVideo(link string) (Data, error)

func Scrape

func Scrape(link string) (Data, error)

type Payload

type Payload struct {
	Time   int64          `json:"time"`
	Length int            `json:"length"`
	Query  []string       `json:"query"`
	Data   []SearchResult `json:"data"`
}

how we send back the result of a search query to the client

type Record

type Record struct {
	//unique identifier
	ID string `json:"id"`
	//title
	Title string `json:"title"`
	//potential link to the source if applicable
	Link string `json:"link"`
	//text content to display on results page
	Content string `json:"content"`
	//map of tokens to their frequency
	TokenFrequency map[string]int `json:"tokenFrequency"`
}

smallest unit of data that we store in the database this will store each "item" in our search engine with all of the necessary information for the interverted index

type SearchResult

type SearchResult struct {
	Title   string `json:"title"`
	Link    string `json:"link"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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