elasticsearch

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: BSD-3-Clause Imports: 20 Imported by: 0

README

go-libraryofcongress-database-elasticsearch

Go package implementing the sfomuseum/go-libraryofcongress-database.LibraryOfCongressDatabase interface for use with Elasticsearch.

Documentation

Documentation is incomplete.

For the time being consult the documentation for sfomuseum/go-libraryofcongress-database-opensearch. Everything is exactly the same with this one difference:

  • Replace opensearchv2:// with elasticsearchv7:// in your database URIs.

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewElasticsearchV7Database

func NewElasticsearchV7Database(ctx context.Context, uri string) (database.LibraryOfCongressDatabase, error)

Types

type ElasticsearchV7Database

type ElasticsearchV7Database struct {
	database.LibraryOfCongressDatabase
	// contains filtered or unexported fields
}

func (*ElasticsearchV7Database) Index

func (elasticsearch_db *ElasticsearchV7Database) Index(ctx context.Context, sources []*database.Source, monitor timings.Monitor) error

func (*ElasticsearchV7Database) Query

func (elasticsearch_db *ElasticsearchV7Database) Query(ctx context.Context, q string, pg_opts pagination.Options) ([]*database.QueryResult, pagination.Results, error)

type QueryResponse

type QueryResponse struct {
	Hits *QueryResponseHits `json:"hits"`
}

type QueryResponseHits

type QueryResponseHits struct {
	Total   *QueryResponseTotal    `json:"total"`
	Results []*QueryResponseResult `json:"hits"`
}

type QueryResponseResult

type QueryResponseResult struct {
	Index  string                `json:"_index"`
	Id     string                `json:"_id"`
	Score  float64               `json:"_score"`
	Result *database.QueryResult `json:"_source"`
}

type QueryResponseTotal

type QueryResponseTotal struct {
	Value    int    `json:"value"`
	Relation string `json:"relation"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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