models

package
v0.0.0-...-bcc76fe Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintESQuery

func PrintESQuery(nss *elastic.SearchSource)

Types

type DB

type DB struct {
	*elastic.Client
}

func ESClient

func ESClient() (*DB, error)

func (*DB) BaseQuery

func (db *DB) BaseQuery(did int, country string, exclIDs []string) (*elastic.BoolQuery, error)

BaseQuery just returns the base query so you can use it for your specifin needs

func (*DB) Count

func (db *DB) Count(did int) (count int)

func (*DB) ExecuteQuery

func (db *DB) ExecuteQuery(q *elastic.BoolQuery) (result []map[string]interface{}, err error)

func (*DB) FindOne

func (db *DB) FindOne(id, did int, ln string) (expert models.Expert, err error)

func (*DB) ForeignSearch

func (db *DB) ForeignSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}

func (*DB) IndexExperts

func (db *DB) IndexExperts(experts []*modelsMysql.Experts, batchInsert int) (err error)

func (*DB) MadnessSearch

func (db *DB) MadnessSearch(fn, mn, ln, country, city string, did int, exclIDs []string) (result []map[string]interface{})

func (*DB) MarkAsDeleted

func (db *DB) MarkAsDeleted(id string) (err error)

func (*DB) NoMiddleNameSearch

func (db *DB) NoMiddleNameSearch(fn, mn, ln, country, city string, did int, exclIDs []string) (result []map[string]interface{})

func (*DB) OneMiddleNameSearch

func (db *DB) OneMiddleNameSearch(fn, mn, ln, country, city string, did int, exclIDs []string) (result []map[string]interface{})

func (*DB) OneMiddleNameSearch2

func (db *DB) OneMiddleNameSearch2(fn, mn, ln, country, city string, did int, exclIDs []string) (result []map[string]interface{})

func (*DB) RemoveData

func (db *DB) RemoveData(did int) (deleted int64, err error)

func (*DB) ShortSearch

func (db *DB) ShortSearch(fn, mn, ln, country, city string, did int, exclIDs []string) (result []map[string]interface{})

func (*DB) SimpleSearch

func (db *DB) SimpleSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}

func (*DB) TestSearch

func (db *DB) TestSearch(fn, mn, ln, country, city string, did int, exclIDs []string) (result []map[string]interface{})

func (*DB) ThreeInitialsSearch

func (db *DB) ThreeInitialsSearch(fn, mn, ln, country, city string, did int, exclIDs []string) (result []map[string]interface{})

func (*DB) UpdatePartially

func (db *DB) UpdatePartially(id string, exp models.Expert) (err error)

type Repository

type Repository interface {
	ExecuteQuery(q *elastic.BoolQuery) ([]map[string]interface{}, error)
	Count(did int) int
	FindOne(id, did int, ln string) (models.Expert, error)
	MarkAsDeleted(id string) (err error)
	UpdatePartially(id string, exp models.Expert) (err error)

	// searches
	BaseQuery(did int, country string, exclIDs []string) (*elastic.BoolQuery, error)
	SimpleSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	ForeignSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	ShortSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	NoMiddleNameSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	OneMiddleNameSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	OneMiddleNameSearch2(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	MadnessSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	ThreeInitialsSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}
	TestSearch(fn, mn, ln, country, city string, did int, exclIDs []string) []map[string]interface{}

	// index
	RemoveData(did int) (int64, error)
	IndexExperts(experts []*modelsMysql.Experts, batchInsert int) error
}

Jump to

Keyboard shortcuts

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