Documentation
¶
Index ¶
- Constants
- func Filter(bits *roaring.Bitmap, fields []*Facet, filters []any) (*roaring.Bitmap, error)
- func FilteredItems(data []map[string]any, ids []any) []map[string]any
- func ItemsByBitmap(data []map[string]any, bits *roaring.Bitmap) []map[string]any
- func SortByAlphaFunc(a *Item, b *Item) int
- func SortByCountFunc(a *Item, b *Item) int
- type Facet
- func (f *Facet) Add(val any, ids []int)
- func (f *Facet) Filter(val string) *roaring.Bitmap
- func (f *Facet) Find(val any) []*Item
- func (f *Facet) FindByIndex(ti ...int) []*Item
- func (f *Facet) FindByLabel(label string) *Item
- func (f *Facet) FindByValue(val string) *Item
- func (f *Facet) Fuzzy(term string) *roaring.Bitmap
- func (f *Facet) GetValues() []string
- func (f *Facet) Keywords() []*Item
- func (f *Facet) Len() int
- func (f *Facet) Search(term string) []*Item
- func (f *Facet) SortTokens() []*Item
- func (f *Facet) String(i int) string
- func (f *Facet) Tokenize(val any) []*Item
- type Fields
- type Item
Constants ¶
View Source
const ( SortByCount = `count` SortByAlpha = `alpha` )
Variables ¶
This section is empty.
Functions ¶
func FilteredItems ¶
FilteredItems returns the subset of data.
func ItemsByBitmap ¶
func SortByAlphaFunc ¶
func SortByCountFunc ¶
Types ¶
type Facet ¶ added in v0.0.24
type Facet struct {
Attribute string `json:"attribute"`
Items []*Item `json:"items"`
Count int `json:"count"`
Sep string `json:"-"`
SortBy string `json:"-"`
Order string `json:"-"`
// contains filtered or unexported fields
}
func (*Facet) FindByIndex ¶ added in v0.0.24
func (*Facet) FindByLabel ¶ added in v0.0.24
func (*Facet) FindByValue ¶ added in v0.0.24
func (*Facet) Len ¶ added in v0.0.24
Len returns the number of items, to satisfy the fuzzy.Source interface.
func (*Facet) SortTokens ¶ added in v0.0.24
type Fields ¶ added in v0.0.24
type Fields struct {
Facets []*Facet `json:"facetFields"`
// contains filtered or unexported fields
}
func (*Fields) MarshalJSON ¶ added in v0.0.24
type Item ¶ added in v0.0.24
type Item struct {
Value string `json:"value"`
Label string `json:"label"`
Count int `json:"count"`
RelatedTo []int `json:"relatedTo"`
Children *Facet `json:"-"`
// contains filtered or unexported fields
}
func KeywordTokenizer ¶
func SortTokensByAlpha ¶
func SortTokensByCount ¶
Click to show internal directories.
Click to hide internal directories.