schema

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Fields   []*FieldEntry `json:"fields"`
	FieldMap map[string]*FieldEntry
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) AddTextField

func (b *Builder) AddTextField(fieldName string, analyzerName string) FieldID

func (*Builder) Build

func (b *Builder) Build() *Schema

type DocID

type DocID uint32
const DocIDTerminated DocID = math.MaxUint32

func (DocID) IsTerminated

func (d DocID) IsTerminated() bool

type Document

type Document struct {
	FieldValues []*FieldValue
}

func (*Document) SortedFieldValues

func (d *Document) SortedFieldValues() []*FieldAndFieldValues

type FieldAndFieldValues

type FieldAndFieldValues struct {
	Field       FieldID
	FieldValues []*FieldValue
}

type FieldEntry

type FieldEntry struct {
	ID           FieldID   `json:"id"`
	Name         string    `json:"name"`
	FieldType    FieldType `json:"fieldType"`
	AnalyzerName string    `json:"analyzer"`
}

type FieldID

type FieldID uint32

type FieldType

type FieldType string
const (
	FieldTypeText FieldType = "text"
)

type FieldValue

type FieldValue struct {
	FieldID FieldID
	Value   Value
}

type Schema

type Schema struct {
	Fields []*FieldEntry `json:"fields"`
	// contains filtered or unexported fields
}

func (*Schema) FieldEntry

func (s *Schema) FieldEntry(fieldID FieldID) *FieldEntry

func (*Schema) FieldIDs

func (s *Schema) FieldIDs() []FieldID

type Term

type Term struct {
	// contains filtered or unexported fields
}

func NewTermFromText

func NewTermFromText(fieldID FieldID, text string) *Term

func (*Term) FieldID

func (t *Term) FieldID() FieldID

func (*Term) Text

func (t *Term) Text() string

type Value

type Value interface{}

Jump to

Keyboard shortcuts

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