Documentation ¶
Overview ¶
Package trigram is a simple trigram index
Index ¶
- type DocID
- type Index
- func (idx Index) Add(s string) DocID
- func (idx Index) AddTrigrams(ts []T) DocID
- func (idx Index) Delete(s string, id DocID)
- func (idx Index) Filter(docs []DocID, ts []T) []DocID
- func (idx Index) FilterOr(docs []DocID, tss [][]T) []DocID
- func (idx Index) Insert(s string, id DocID)
- func (idx Index) InsertTrigrams(ts []T, id DocID)
- func (idx Index) Prune(pct float64) int
- func (idx Index) Query(s string) []DocID
- func (idx Index) QueryTrigrams(ts []T) []DocID
- func (idx Index) Sort()
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
Index is a trigram index
func (Index) AddTrigrams ¶
AddTrigrams adds a set of trigrams to the search index
func (Index) FilterOr ¶
FilterOr removes documents that don't contain any of the list of specified trigrams in other words, it's the union of the results of invidial filters
func (Index) InsertTrigrams ¶
InsertTrigrams adds a set of trigrams with a given document ID
func (Index) Prune ¶
Prune removes all trigrams that are present in more than the specified percentage of the documents.
func (Index) QueryTrigrams ¶
QueryTrigrams returns a list of document IDs that match the trigram set ts
Click to show internal directories.
Click to hide internal directories.