query

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatMultiQuery

func FormatMultiQuery(rawQuery []byte) ([]byte, error)

FormatMultiQuery minifies and reformats an elasticsearch MultiQuery

func SetupSearch

func SetupSearch(pathToTemplates string) (*template.Template, error)

SetupSearch loads templates for use by the search handler and should be done only once

Types

type Builder

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

Builder represents an instance of a query builder

func NewQueryBuilder

func NewQueryBuilder(pathToTemplates string) (*Builder, error)

NewQueryBuilder loads the elastic search templates and returns a query builder instance

func (*Builder) BuildSearchQuery

func (sb *Builder) BuildSearchQuery(ctx context.Context, q, contentTypes, sort string, limit, offset int) ([]byte, error)

BuildSearchQuery creates an elastic search query from the provided search parameters

Jump to

Keyboard shortcuts

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