tantivy

package
v0.0.0-...-73cb4e1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const NOSNIPPET = -1

Variables

This section is empty.

Functions

func ClearSession

func ClearSession(sessionID string)

func LibInit

func LibInit(directive ...string)

func SetKB

func SetKB(k float64, b float64)

Types

type FieldEntry

type FieldEntry struct {
	Name    string                 `json:"name"`
	Type    string                 `json:"type"`
	Options map[string]interface{} `json:"options"`
}

type JPCId

type JPCId struct {
	TempDir string
	// contains filtered or unexported fields
}

The ccomsBuf is a raw byte buffer for tantivy-jpc to send results. A single mutex guards its use.

func (*JPCId) ID

func (j *JPCId) ID() string

type StorageKind

type StorageKind uint
const (
	STRING StorageKind = 1
	TEXT   StorageKind = 2
	INT    StorageKind = 3
	UINT   StorageKind = 4
	JSON   StorageKind = 5
)

type TBuilder

type TBuilder struct {
	*JPCId
}

func NewBuilder

func NewBuilder(td string) (*TBuilder, error)

func (*TBuilder) AddDateField

func (tb *TBuilder) AddDateField(name string, fieldType StorageKind, stored bool, indexed bool, fast bool) (int, error)

func (*TBuilder) AddF64Field

func (tb *TBuilder) AddF64Field(name string, fieldType StorageKind, stored bool, indexed bool, fast bool) (int, error)

func (*TBuilder) AddI64Field

func (tb *TBuilder) AddI64Field(name string, fieldType StorageKind, stored bool, indexed bool, fast bool) (int, error)

func (*TBuilder) AddJsonField

func (tb *TBuilder) AddJsonField(name string, fieldType StorageKind, stored bool, fast bool, tokenizer string, basic bool) (int, error)

func (*TBuilder) AddTextField

func (tb *TBuilder) AddTextField(name string, fieldType StorageKind, stored bool, fast bool, tokenizer string, basic bool) (int, error)

func (*TBuilder) AddU64Field

func (tb *TBuilder) AddU64Field(name string, fieldType StorageKind, stored bool, indexed bool, fast bool) (int, error)

func (*TBuilder) Build

func (tb *TBuilder) Build() (*TDocument, error)

func (*TBuilder) CreateIndex

func (tb *TBuilder) CreateIndex(memsize ...uint32) (*TIndex, error)

type TDocument

type TDocument struct {
	*JPCId
	// contains filtered or unexported fields
}

func (*TDocument) AddInt

func (td *TDocument) AddInt(field int, value int64, doc_id uint) (int, error)

func (*TDocument) AddJson

func (td *TDocument) AddJson(field int, value map[string]interface{}, doc_id uint) (int, error)

func (*TDocument) AddText

func (td *TDocument) AddText(field int, value string, doc_id uint) (int, error)

func (*TDocument) AddUInt

func (td *TDocument) AddUInt(field int, value uint64, doc_id uint) (int, error)

func (*TDocument) Create

func (td *TDocument) Create() (uint, error)

func (*TDocument) CreateIndex

func (td *TDocument) CreateIndex() (*TIndex, error)

type TIndex

type TIndex struct {
	*JPCId
}

func (*TIndex) CreateIndexWriter

func (idx *TIndex) CreateIndexWriter() (*TIndexWriter, error)

func (*TIndex) GetSchema

func (idx *TIndex) GetSchema() *TSchema

func (*TIndex) ReaderBuilder

func (idx *TIndex) ReaderBuilder() (*TIndexReader, error)

func (*TIndex) SetMultiThreadExecutor

func (idx *TIndex) SetMultiThreadExecutor(threadCount int32) (*TIndex, error)

type TIndexReader

type TIndexReader struct {
	*TIndex
}

func (*TIndexReader) Searcher

func (idr *TIndexReader) Searcher() (*TQueryParser, error)

type TIndexWriter

type TIndexWriter struct {
	*TIndex
}

func (*TIndexWriter) AddDocument

func (idw *TIndexWriter) AddDocument(docid uint) (uint, error)

func (*TIndexWriter) Commit

func (idw *TIndexWriter) Commit() (uint64, error)

func (*TIndexWriter) DeleteTerm

func (idw *TIndexWriter) DeleteTerm(field, term interface{}) (uint, error)

type TQueryParser

type TQueryParser struct {
	*TIndex
}

func (*TQueryParser) ForIndex

func (qp *TQueryParser) ForIndex(fields []string) (uint, error)

func (*TQueryParser) ParseFuzzyQuery

func (qp *TQueryParser) ParseFuzzyQuery(field, term string) (*TSearcher, error)

func (*TQueryParser) ParseQuery

func (qp *TQueryParser) ParseQuery(query string) (*TSearcher, error)

type TSchema

type TSchema struct {
	*JPCId
}

func (*TSchema) Fields

func (idr *TSchema) Fields() (msi, error)

func (*TSchema) GetField

func (idr *TSchema) GetField(name string) (uint64, error)

func (*TSchema) GetFieldEntry

func (idr *TSchema) GetFieldEntry(fieldName string) (*FieldEntry, error)

func (*TSchema) NumFields

func (idr *TSchema) NumFields() (uint64, error)

type TSearcher

type TSearcher struct {
	*TQueryParser
}

func (*TSearcher) Docset

func (s *TSearcher) Docset(scoring bool, topLimit uint64, offset uint64) (string, error)

func (*TSearcher) FuzzySearch

func (s *TSearcher) FuzzySearch(topLimit ...uint64) (string, error)

func (*TSearcher) GetDocument

func (s *TSearcher) GetDocument(explain bool, score float32, docId uint32, segOrd uint32, snippetField ...string) (string, error)

func (*TSearcher) Search

func (s *TSearcher) Search(explain bool, topLimit uint64, offset uint64, ordered bool, snippetField ...string) (string, error)

func (*TSearcher) SearchRaw

func (s *TSearcher) SearchRaw() (string, error)

Directories

Path Synopsis
packaged
include
See https://github.com/golang/go/issues/26366.
See https://github.com/golang/go/issues/26366.
lib
See https://github.com/golang/go/issues/26366.
See https://github.com/golang/go/issues/26366.
lib/darwin-aarch64
See https://github.com/golang/go/issues/26366.
See https://github.com/golang/go/issues/26366.
lib/darwin-amd64
See https://github.com/golang/go/issues/26366.
See https://github.com/golang/go/issues/26366.

Jump to

Keyboard shortcuts

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