textinvertedindex

package
v0.0.0-...-bbf0bf7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextInvertedIndex

type TextInvertedIndex[T indexer.ValidType] struct {
	Metadata  indexer.IndexMetadata[T]   `json:"metadata"`
	Index     map[string]*roaring.Bitmap `json:"index"`
	StopWords mapset.Set[string]         `json:"-"`
}

func New

func New[T indexer.ValidType](columnName string) *TextInvertedIndex[T]

New creates a new Text InvertedIndex object English is the only language supported

func (*TextInvertedIndex[T]) AddValue

func (i *TextInvertedIndex[T]) AddValue(id string, value interface{}) bool

AddValue adds the current value for the given id to the index

func (*TextInvertedIndex[T]) Deserialize

func (i *TextInvertedIndex[T]) Deserialize(data []byte) error

func (*TextInvertedIndex[T]) GetColumnName

func (i *TextInvertedIndex[T]) GetColumnName() string

func (*TextInvertedIndex[T]) GetIndexType

func (i *TextInvertedIndex[T]) GetIndexType() indexer.IndexType

func (*TextInvertedIndex[T]) MarshalJSON

func (i *TextInvertedIndex[T]) MarshalJSON() ([]byte, error)

func (*TextInvertedIndex[T]) Search

func (i *TextInvertedIndex[T]) Search(value interface{}) []uint32

Search queries the index for the given text.

type TextInvertedIndexJSON

type TextInvertedIndexJSON[T indexer.ValidType] struct {
	Metadata indexer.IndexMetadata[T] `json:"metadata"`
	Indexes  []TextMapIdsJSON         `json:"index"`
}

type TextMapIdsJSON

type TextMapIdsJSON struct {
	Key string   `json:"key"`
	Ids []uint32 `json:"ids"`
}

Jump to

Keyboard shortcuts

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