esutil

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OP_AND = "AND"
	OP_OR  = "OR"
)
View Source
const (
	Must    = "must"
	Should  = "should"
	Filter  = "filter"
	MustNot = "must_not"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EsEntry

type EsEntry map[string]any

type EsSearchHelper

type EsSearchHelper struct {
	Query     *types.Query
	Sorters   []types.SortCombinations
	From      int
	Size      int
	Highlight *types.Highlight
	Source    *types.SourceConfig
	Aggs      map[string]types.Aggregations
	Index     Index
	// contains filtered or unexported fields
}

func NewEsSearchHelper

func NewEsSearchHelper(index Index) *EsSearchHelper

func (*EsSearchHelper) Build

func (es *EsSearchHelper) Build() *search.Request

func (*EsSearchHelper) PrintReq

func (es *EsSearchHelper) PrintReq() *EsSearchHelper

func (*EsSearchHelper) SetBoolMultiMatch

func (es *EsSearchHelper) SetBoolMultiMatch(query string, fields []string, compositeType string) *EsSearchHelper

SetBoolMultiMatch sets the bool Query's multi match Query. NOTE: CompositeType MUST be one of Must, Should, Filter, or MustNot.

func (*EsSearchHelper) SetBoolTerm

func (es *EsSearchHelper) SetBoolTerm(field string, value any, compositeType string) *EsSearchHelper

func (*EsSearchHelper) SetMultiMatch

func (es *EsSearchHelper) SetMultiMatch(query string, op string, fuzziness string, fields ...string) *EsSearchHelper

SetMultiMatch sets the multi match query. If fuzziness is empty, it will be set to "AUTO".

func (*EsSearchHelper) SetSearchFrom

func (es *EsSearchHelper) SetSearchFrom(from int) *EsSearchHelper

func (*EsSearchHelper) SetSearchSize

func (es *EsSearchHelper) SetSearchSize(size int) *EsSearchHelper

func (*EsSearchHelper) SetTerm

func (es *EsSearchHelper) SetTerm(field string, value any) *EsSearchHelper

func (*EsSearchHelper) WithContext

func (es *EsSearchHelper) WithContext(ctx context.Context) *EsSearchHelper

type Index

type Index interface {
	GetIndexName() string
	GetMapping() string
}

Jump to

Keyboard shortcuts

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