search

package
v0.0.0-...-974506c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BleveIndex

type BleveIndex struct {
	Idx bleve.Index
	// contains filtered or unexported fields
}

BleveIndex implements the repository interface

func NewBleveIndex

func NewBleveIndex(db *sql.DB, conf config.Configuration) *BleveIndex

NewBleveIndex constructs a new repository

func (*BleveIndex) GenerateFromDatabase

func (bi *BleveIndex) GenerateFromDatabase() error

GenerateFromDatabase creates full-text search index

func (*BleveIndex) SubscribeAndCreateIndex

func (bi *BleveIndex) SubscribeAndCreateIndex() *pq.Listener

SubscribeAndCreateIndex creates full-text search index

type IndexRepository

type IndexRepository interface {
	GenerateFromDatabase() error
	SubscribeAndCreateIndex()
}

IndexRepository to manage search

type Item

type Item struct {
	Num            int        `json:"num"`
	Title          string     `json:"title"`
	Description    string     `json:"description"`
	Comments       []string   `json:"comment"`
	Project        string     `json:"project"`
	Labels         []string   `json:"label"`
	Milestones     []string   `json:"milestone"`
	Author         string     `json:"author"`
	Editor         string     `json:"editor"`
	Created        time.Time  `json:"created"`
	Updated        *time.Time `json:"updated"`
	Assignees      []string   `json:"assignee"`
	Subscribers    []string   `json:"subscriber"`
	State          string     `json:"state"`
	Mentions       []string   `json:"mention"`
	CommentAuthors []string   `json:"comment_author"`
	CommentEditors string     `json:"comment_editor"`
	CommentCreated time.Time  `json:"comment_created"`
	CommentUpdated *time.Time `json:"comment_updated"`
}

Item to index

func (*Item) Type

func (i *Item) Type() string

Type of the document for custom mapping

Jump to

Keyboard shortcuts

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