engine

package
v0.0.0-...-9f6fd05 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	SecondsInADay     = 86400
	MaxTokenProximity = 2
)
View Source
const Blog_Index_Name = "ik_g_blogs"

Variables

View Source
var (
	ElasticClient *elastic.Client
)

Functions

func CloseSearcher

func CloseSearcher()

func ElasticSearch

func ElasticSearch(query string, isAdmin bool) []models.Blog

func InitElasticSearch

func InitElasticSearch() error

func InitSearcher

func InitSearcher() error

****************************************************************************** 主函数 ******************************************************************************

func SearchResult

func SearchResult(query string, isAdmin bool) []models.Blog

****************************************************************************** search ******************************************************************************

Types

type BlogScoringCriteria

type BlogScoringCriteria struct {
}

func (BlogScoringCriteria) Score

func (criteria BlogScoringCriteria) Score(doc types.IndexedDocument, fields interface{}) []float32

type BlogScoringFields

type BlogScoringFields struct {
	BlogLastUpdate uint64
	BlogViews      uint64
}

****************************************************************************** 评分 ******************************************************************************

type ElasticBlog

type ElasticBlog struct {
	Id      string `json:"id"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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