repository

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

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocumentKeyPrefix     = "doc:%s"
	WordDocumentKeyFormat = "ri:%s_%x"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexRepository

type IndexRepository struct {
	DB *badger.DB
	// contains filtered or unexported fields
}

func NewIndexRepository

func NewIndexRepository(path string, logger *logger.Logger, chunkSize int) (*IndexRepository, error)

func (*IndexRepository) FlushAll

func (ir *IndexRepository) FlushAll()

func (*IndexRepository) GetAllDocuments

func (ir *IndexRepository) GetAllDocuments() ([]*model.Document, error)

func (*IndexRepository) GetDocumentByID

func (ir *IndexRepository) GetDocumentByID(docID [32]byte) (*model.Document, error)

func (*IndexRepository) GetDocumentsByWord

func (ir *IndexRepository) GetDocumentsByWord(word string) (map[[32]byte]model.WordCountAndPositions, error)

func (*IndexRepository) GetDocumentsCount

func (ir *IndexRepository) GetDocumentsCount() (int, error)

func (*IndexRepository) GetFreq

func (ir *IndexRepository) GetFreq(l, r uint64) (int, error)

func (*IndexRepository) GetPageUrlsByHash

func (ir *IndexRepository) GetPageUrlsByHash(hash [32]byte) ([]byte, error)

func (*IndexRepository) GetSimilarSignatures

func (ir *IndexRepository) GetSimilarSignatures(signature [128]uint64) ([][128]uint64, error)

func (*IndexRepository) GetWordsByNGram

func (ir *IndexRepository) GetWordsByNGram(word string, n int) ([]string, error)

func (*IndexRepository) IndexDocShingles

func (ir *IndexRepository) IndexDocShingles(signature [128]uint64) error

func (*IndexRepository) IndexDocumentWords

func (ir *IndexRepository) IndexDocumentWords(docID [32]byte, sequence map[string]int, pos map[string][]model.Position) error

func (*IndexRepository) IndexNGrams

func (ir *IndexRepository) IndexNGrams(words []string, n int) error

func (*IndexRepository) IndexUrlsByHash

func (ir *IndexRepository) IndexUrlsByHash(hash [32]byte, urlsStruct []byte) error

func (*IndexRepository) LoadVisitedUrls

func (ir *IndexRepository) LoadVisitedUrls(visitedURLs *sync.Map) error

func (*IndexRepository) SaveDocument

func (ir *IndexRepository) SaveDocument(doc *model.Document) error

func (*IndexRepository) SaveSaltArrays

func (ir *IndexRepository) SaveSaltArrays(a, b [128]uint64) error

func (*IndexRepository) SaveVisitedUrls

func (ir *IndexRepository) SaveVisitedUrls(visitedURLs *sync.Map) error

func (*IndexRepository) UpdateBiFreq

func (ir *IndexRepository) UpdateBiFreq(biS map[[2]uint64]int) error

func (*IndexRepository) UpdateChunkingCounts

func (ir *IndexRepository) UpdateChunkingCounts() error

func (*IndexRepository) UploadSaltArrays

func (ir *IndexRepository) UploadSaltArrays() ([128]uint64, [128]uint64, error)

Jump to

Keyboard shortcuts

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