query

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 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() (*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() (*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