Documentation
¶
Index ¶
- Constants
- func GetNumberOfPages(total int, pageSize int) int
- type FilterInterface
- type Filterer
- type Indexer
- func (i *Indexer) AddIndex(tokens []string, index uint32)
- func (i *Indexer) AddIndexesAsync(documents []WikiXMLDoc, wg *sync.WaitGroup)
- func (i *Indexer) Analyze(s string) []string
- func (i *Indexer) DownloadWikimediaDump(path string, url string) error
- func (i *Indexer) IsFileExists(path string) bool
- func (i *Indexer) LoadDataDump(path string) error
- func (i *Indexer) LoadIndexDump(path string) error
- func (i *Indexer) LoadWikimediaDump(path string, save bool, indexPath string, dataPath string) error
- func (i *Indexer) SaveDataDump(path string) error
- func (i *Indexer) SaveIndexDump(path string) error
- func (i *Indexer) Search(s string, page uint32) SearchResults
- func (i *Indexer) UncompressWikimediaDump(path string) error
- type IndexerInterface
- type Processed
- type SearchResult
- type SearchResults
- type Stemmer
- type StemmerInterface
- type Tokenizer
- type TokenizerInterface
- type WikiXMLDoc
Constants ¶
View Source
const ( XmlStreamBufferSize = 1024 * 1024 * 1 // 1MB DocumentCapacity = 524288 // 2^19 PageSize = 25 )
Variables ¶
This section is empty.
Functions ¶
func GetNumberOfPages ¶
Types ¶
type FilterInterface ¶
type Indexer ¶
type Indexer struct {
Data map[uint32]WikiXMLDoc
Indexes map[string]*roaring.Bitmap
Tokenizer *Tokenizer
Filterer *Filterer
Stemmer *Stemmer
Mutex sync.Mutex
Cores int
Multiplier int
}
func NewIndexer ¶
func NewIndexer() *Indexer
func (*Indexer) AddIndexesAsync ¶
func (i *Indexer) AddIndexesAsync(documents []WikiXMLDoc, wg *sync.WaitGroup)
func (*Indexer) DownloadWikimediaDump ¶
func (*Indexer) IsFileExists ¶
func (*Indexer) LoadDataDump ¶
func (*Indexer) LoadIndexDump ¶
func (*Indexer) LoadWikimediaDump ¶
func (*Indexer) SaveDataDump ¶
func (*Indexer) SaveIndexDump ¶
func (*Indexer) UncompressWikimediaDump ¶
type IndexerInterface ¶
type IndexerInterface interface {
DownloadWikimediaDump(path string, url string) error
UncompressWikimediaDump(path string) error
LoadWikimediaDump(path string, save bool, indexPath string, dataPath string) error
LoadIndexDump(path string) error
LoadDataDump(path string) error
SaveIndexDump(path string) error
SaveDataDump(path string) error
IsFileExists(path string) bool
Analyze(s string) []string
AddIndex(tokens []string, index uint32)
AddIndexesAsync(documents []WikiXMLDoc, wg *sync.WaitGroup)
Search(s string) SearchResults
}
type SearchResult ¶
type SearchResult struct {
Url string `json:"url"`
Rank float64 `json:"rank"`
Title string `json:"title"`
Abstract string `json:"abstract"`
}
func SliceSearchResults ¶
func SliceSearchResults(results []SearchResult, currentPage int) []SearchResult
type SearchResults ¶
type SearchResults struct {
Processed Processed `json:"processed"`
NumberOfResults int `json:"number_of_results"`
CurrentPage int `json:"current_page"`
NumberOfPages int `json:"number_of_pages"`
Results []SearchResult `json:"results"`
}
type StemmerInterface ¶
type TokenizerInterface ¶
Click to show internal directories.
Click to hide internal directories.