core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

索引器

func (*Indexer) AddDocument

func (indexer *Indexer) AddDocument(document *types.DocumentIndex)

向反向索引表中加入一个文档

func (*Indexer) Init

func (indexer *Indexer) Init(options types.IndexerInitOptions)

初始化索引器

func (*Indexer) Lookup

func (indexer *Indexer) Lookup(tokens []string, labels []string, docIds map[string]bool, countDocsOnly bool) (docs []types.IndexedDocument, numDocs int)

查找包含全部搜索键(AND操作)的文档 当docIds不为nil时仅从docIds指定的文档中查找

func (*Indexer) RemoveDoc

func (indexer *Indexer) RemoveDoc(docId string)

删除某个文档

type KeywordIndices

type KeywordIndices struct {
	// contains filtered or unexported fields
}

反向索引表的一行,收集了一个搜索键出现的所有文档,按照DocId从小到大排序。

type Ranker

type Ranker struct {
	// contains filtered or unexported fields
}

func (*Ranker) AddDoc

func (ranker *Ranker) AddDoc(docId string, fields interface{})

给某个文档添加评分字段

func (*Ranker) Init

func (ranker *Ranker) Init()

func (*Ranker) Rank

func (ranker *Ranker) Rank(
	docs []types.IndexedDocument, options types.RankOptions, countDocsOnly bool) (types.ScoredDocuments, int)

给文档评分并排序

func (*Ranker) RemoveDoc

func (ranker *Ranker) RemoveDoc(docId string)

删除某个文档的评分字段

Jump to

Keyboard shortcuts

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