Documentation
¶
Index ¶
- type Indexer
- func (indexer *Indexer) AddDocumentToCache(document *types.DocumentIndex, forceUpdate bool)
- func (indexer *Indexer) AddDocuments(documents *types.DocumentsIndex)
- func (indexer *Indexer) Init(options types.IndexerInitOptions)
- func (indexer *Indexer) Lookup(tokens []string, labels []string, docIDs map[uint64]bool, countDocsOnly bool) (docs []types.IndexedDocument, numDocs int)
- func (indexer *Indexer) RemoveDocumentToCache(docID uint64, forceUpdate bool) bool
- func (indexer *Indexer) RemoveDocuments(documents *types.DocumentsID)
- type KeywordIndices
- type Ranker
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
}
Indexer 索引器
func (*Indexer) AddDocumentToCache ¶
func (indexer *Indexer) AddDocumentToCache(document *types.DocumentIndex, forceUpdate bool)
AddDocumentToCache 向 ADDCACHE 中加入一个文档
func (*Indexer) AddDocuments ¶
func (indexer *Indexer) AddDocuments(documents *types.DocumentsIndex)
AddDocuments 向反向索引表中加入 ADDCACHE 中所有文档
func (*Indexer) Lookup ¶
func (indexer *Indexer) Lookup( tokens []string, labels []string, docIDs map[uint64]bool, countDocsOnly bool) (docs []types.IndexedDocument, numDocs int)
Lookup 查找包含全部搜索键(AND操作)的文档 当docIDs不为nil时仅从docIDs指定的文档中查找
func (*Indexer) RemoveDocumentToCache ¶
RemoveDocumentToCache 向 REMOVECACHE 中加入一个待删除文档 返回值表示文档是否在索引表中被删除
func (*Indexer) RemoveDocuments ¶
func (indexer *Indexer) RemoveDocuments(documents *types.DocumentsID)
RemoveDocuments 向反向索引表中删除 REMOVECACHE 中所有文档
type KeywordIndices ¶
type KeywordIndices struct {
// contains filtered or unexported fields
}
KeywordIndices 反向索引表的一行,收集了一个搜索键出现的所有文档,按照DocID从小到大排序。
type Ranker ¶
type Ranker struct {
// contains filtered or unexported fields
}
Ranker 排序器
func (*Ranker) Rank ¶
func (ranker *Ranker) Rank( docs []types.IndexedDocument, options types.RankOptions, countDocsOnly bool) (types.ScoredDocuments, int)
Rank 给文档评分并排序
Click to show internal directories.
Click to hide internal directories.