core

package
v0.0.0-...-3722fa4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexByName

func IndexByName(name string) bleve.Index

func IndexNames

func IndexNames() []string

func RegisterIndexName

func RegisterIndexName(name string, idx bleve.Index)

func UnregisterIndexByName

func UnregisterIndexByName(name string) bleve.Index

Types

type DocCountResult

type DocCountResult struct {
	Status string `json:"status"`
	Count  uint64 `json:"count"`
}

func DocCount

func DocCount(indexName string) (DocCountResult, error)

type IndexDetails

type IndexDetails struct {
	Success bool                 `json:"success"`
	Status  string               `json:"status"`
	Name    string               `json:"name"`
	Mapping mapping.IndexMapping `json:"mapping"`
}

type IndexService

type IndexService struct {
}

func NewIndexService

func NewIndexService() *IndexService

func (*IndexService) CreateIndex

func (i *IndexService) CreateIndex(path string, indexName string) (bleve.Index, error)

func (*IndexService) DeleteIndex

func (i *IndexService) DeleteIndex(path string, indexName string) (OperationResult, error)

func (*IndexService) InitIndex

func (i *IndexService) InitIndex(dataDir string)

func (*IndexService) ListIndexes

func (i *IndexService) ListIndexes() Indexes

func (*IndexService) ShowIndex

func (i *IndexService) ShowIndex(indexName string) (interface{}, error)

type IndexStats

type IndexStats struct {
	Name     string `json:"name"`
	DocCount uint64 `json:"docCount"`
	Success  bool   `json:"success"`
}

type Indexes

type Indexes struct {
	Status  string   `json:"status"`
	Indexes []string `json:"indexes"`
}

type OperationResult

type OperationResult struct {
	Success bool
	Message string
	Data    interface{}
}

func DeleteDoc

func DeleteDoc(indexName string, docId string) (*OperationResult, error)
func Search(indexName string, jsonSearchQuery []byte) (*OperationResult, error)

Search query sample for testing purpouses

{
	"size": 10,
	"from": 0,
	"explain": false,
	"highlight": {},
	"query": {
		"boost": 1,
		"query": "teste"
	},
	"fields": [
		"*"
	]
}

func ShowDoc

func ShowDoc(indexName string, docId string) (OperationResult, error)

func UpsertDoc

func UpsertDoc(indexName string, docId string, docData []byte) (OperationResult, error)

Jump to

Keyboard shortcuts

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