quickwit

package module
v0.0.0-...-2c22dbb Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: MIT Imports: 11 Imported by: 0

README

quickwit

quickwit go client

Documentation

Index

Constants

View Source
const (
	IngestBufferSize       = 10000
	IngestBatchSize        = 1000
	IngestMaxDelay         = time.Second
	IngestConcurrent       = 2
	IngestTimeout          = 15 * time.Second
	ReduceBatchSizeToRatio = 0.9 // reduce 10% of the batch size
	ReduceBatchSizeMin     = 0.1 // do not reduce below 10% of the default batch size
	ResetBatchSizeAfter    = 10 * time.Minute
)

Variables

This section is empty.

Functions

func Ptr

func Ptr[T any](t T) *T

Types

type Client

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

func NewClient

func NewClient(endpoint string) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) Ingest

func (c *Client) Ingest(data ...any)

Ingest sends data to the quickwit server. The data can be any type, and will be marshalled to JSON. The data will be buffered until the buffer is full, then sent to the server. If the buffer is full, Ingest will block until the buffer is no longer full.

func (*Client) OnDiscard

func (c *Client) OnDiscard(f OnDiscardFunc)

func (*Client) Search

func (c *Client) Search(ctx context.Context, query string, opt *SearchOpt) (*SearchResult, error)

func (*Client) SetAuth

func (c *Client) SetAuth(auth func(req *http.Request))

func (*Client) SetAutoReduceBatchSize

func (c *Client) SetAutoReduceBatchSize(autoReduceBatchSize bool)

func (*Client) SetBatchSize

func (c *Client) SetBatchSize(batchSize int)

func (*Client) SetConcurrent

func (c *Client) SetConcurrent(concurrent int)

func (*Client) SetDiscard

func (c *Client) SetDiscard(discard bool)

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client)

func (*Client) SetIngestBufferSize

func (c *Client) SetIngestBufferSize(size int)

func (*Client) SetIngestTimeout

func (c *Client) SetIngestTimeout(timeout time.Duration)

func (*Client) SetMaxDelay

func (c *Client) SetMaxDelay(maxDelay time.Duration)

type OnDiscardFunc

type OnDiscardFunc func(any)

type SearchOpt

type SearchOpt struct {
	StartTimestamp int64
	EndTimestamp   int64
	StartOffset    int64
	MaxHits        int64
	SearchField    []string
	SnippetFields  []string
	SortBy         string
	Format         string
}

type SearchResult

type SearchResult struct {
	Hits              json.RawMessage
	NumHits           int64
	ElapsedTimeMicros int64
}

Jump to

Keyboard shortcuts

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