api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupRouter

func SetupRouter(indexRepository repository.IndexRepo) *gin.Engine

Types

type DocumentDTO

type DocumentDTO struct {
	ID   string `json:"id" binding:"required"`
	Text string `json:"text" binding:"required"`
}

type DocumentScoreDTO

type DocumentScoreDTO struct {
	ID    string  `json:"id"`
	Text  string  `json:"text,omitempty"`
	Score float64 `json:"score"`
}

type DocumentUpdateDTO

type DocumentUpdateDTO struct {
	Text string `json:"text" binding:"required"`
}

type IndexCtrl

type IndexCtrl struct {
	IndexRepository repository.IndexRepo
}

func (IndexCtrl) Analyze

func (ic IndexCtrl) Analyze(c *gin.Context)

func (IndexCtrl) CreateDocument

func (ic IndexCtrl) CreateDocument(c *gin.Context)

func (IndexCtrl) CreateIndex

func (ic IndexCtrl) CreateIndex(c *gin.Context)

func (IndexCtrl) DeleteDocument

func (ic IndexCtrl) DeleteDocument(c *gin.Context)

func (IndexCtrl) DeleteIndex

func (ic IndexCtrl) DeleteIndex(c *gin.Context)

func (IndexCtrl) GetDocument

func (ic IndexCtrl) GetDocument(c *gin.Context)

func (IndexCtrl) GetIndex

func (ic IndexCtrl) GetIndex(c *gin.Context)

func (IndexCtrl) GetIndexes

func (ic IndexCtrl) GetIndexes(c *gin.Context)

func (IndexCtrl) SearchDocuments

func (ic IndexCtrl) SearchDocuments(c *gin.Context)

func (IndexCtrl) Suggestions

func (ic IndexCtrl) Suggestions(c *gin.Context)

func (IndexCtrl) TopTerms

func (ic IndexCtrl) TopTerms(c *gin.Context)

func (IndexCtrl) UpdateDocument

func (ic IndexCtrl) UpdateDocument(c *gin.Context)

type IndexInputDTO

type IndexInputDTO struct {
	ID        string            `json:"id" binding:"required"`
	Analyzer  string            `json:"analyzer" binding:"required"`
	Stopwords []string          `json:"stopwords,omitempty"`
	Synonyms  map[string]string `json:"synonyms,omitempty"`
	Stemmer   string            `json:"stemmer,omitempty"`
	Fuzziness *struct {
		MinTermCount    int `json:"min_term_count,omitempty"`
		MaxEditDistance int `json:"max_edit_distance,omitempty"`
	} `json:"fuzziness,omitempty"`
}

type IndexOutputDTO

type IndexOutputDTO struct {
	ID        string            `json:"id"`
	Analyzer  string            `json:"analyzer"`
	Docs      int               `json:"docs"`
	Stopwords []string          `json:"stopwords,omitempty"`
	Synonyms  map[string]string `json:"synonyms,omitempty"`
	Stemmer   string            `json:"stemmer,omitempty"`
}

type SearchInputDTO

type SearchInputDTO struct {
	Query       string
	Filter      string
	MinMatch    *int   `json:"min_match"`
	TfWeight    string `json:"tf_weight"`
	IdfWeight   string `json:"idf_weight"`
	IncludeText bool   `json:"include_text"`
	Top         int
}

type SearchOutputDTO

type SearchOutputDTO struct {
	Docs []DocumentScoreDTO `json:"docs"`
	Size int                `json:"size"`
}

Jump to

Keyboard shortcuts

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