meilisearch

package module
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 11 Imported by: 254

README ΒΆ

MeiliSearch-Go

MeiliSearch Go

MeiliSearch | Website | Blog | Twitter | Documentation | FAQ

GitHub Workflow Status Test License Slack

⚑ Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine MeiliSearch client written in Go

MeiliSearch Go is a client for MeiliSearch written in Go. MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, and synonyms are provided out-of-the-box.

Table of Contents

πŸ”§ Installation

With go get in command line:

$ go get github.com/meilisearch/meilisearch-go

Run MeiliSearch

There are many easy ways to download and run a MeiliSearch instance.

For example, if you use Docker:

$ docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey

NB: you can also download MeiliSearch from Homebrew or APT.

πŸš€ Getting started

Add documents
package main

import (
    "fmt"
    "os"

    "github.com/meilisearch/meilisearch-go"
)

func main() {
    var client = meilisearch.NewClient(meilisearch.Config{
        Host: "http://127.0.0.1:7700",
        APIKey: "masterKey",
    })

    // Create an index if your index does not already exist
    _, err := client.Indexes().Create(meilisearch.CreateIndexRequest{
        UID: "books",
    })
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    documents := []map[string]interface{}{
        {"book_id": 123,  "title": "Pride and Prejudice"},
        {"book_id": 456,  "title": "Le Petit Prince"},
        {"book_id": 1,    "title": "Alice In Wonderland"},
        {"book_id": 1344, "title": "The Hobbit"},
        {"book_id": 4,    "title": "Harry Potter and the Half-Blood Prince"},
        {"book_id": 42,   "title": "The Hitchhiker's Guide to the Galaxy"},
    }

    updateRes, err := client.Documents("books").AddOrUpdate(documents) // => { "updateId": 0 }
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    fmt.Println(updateRes.UpdateID)
}

With the updateId, you can check the status (processed or failed) of your documents addition thanks to this method.

Search in index
package main

import (
    "fmt"
    "os"

    "github.com/meilisearch/meilisearch-go"
)

func main() {
    // MeiliSearch is typo-tolerant:
    searchRes, err := client.Search("books").Search(meilisearch.SearchRequest{
        Query: "harry pottre",
        Limit: 10,
    })
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    fmt.Println(searchRes.Hits)
}

JSON output:

{
  "hits": [{
    "book_id": 4,
    "title": "Harry Potter and the Half-Blood Prince"
  }],
  "offset": 0,
  "limit": 10,
  "processingTimeMs": 1,
  "query": "harry pottre"
}

πŸ€– Compatibility with MeiliSearch

This package is compatible with the following MeiliSearch versions:

  • v0.12.X
  • v0.11.X

🎬 Examples

All HTTP routes of MeiliSearch are accessible via methods in this SDK.
You can check out the API documentation.

Indexes

Create an index
// Create an index with a specific uid (uid must be unique)
resp, err := client.Indexes().Create(meilisearch.CreateIndexRequest{
    UID: "books",
})
// Create an index with a primary key
resp, err := client.Indexes().Create(meilisearch.CreateIndexRequest{
    UID: "books",
    PrimaryKey: "book_id",
})
List all indexes
list, err := client.Indexes().List()
Get an index object
index, err := client.Indexes().Get("books")

Documents

Fetch documents
// Get one document
var document map[int]interface{}
err := client.Documents("books").Get("123", &doc)
// Get documents by batch
var list []map[int]interface{}
err = client.Documents("books").List(ListDocumentsRequest{
    Offset: 0,
    Limit:  10,
}, &list)
Add documents
documents := []map[string]interface{}{
    {BookID: 90, Title: "Madame Bovary"},
}

upd_res, err := client.Documents("books").AddOrUpdate(documents)

Response:

{
    "updateId": 1
}

With this updateId you can track your operation update.

Delete documents
// Delete one document
updateRes, err = client.Documents("books").Delete("123")
// Delete several documents
updateRes, err = client.Documents("books").Deletes([]string{"123", "456"})
// Delete all documents /!\
updateRes, err = client.Documents("books").DeleteAllDocuments()

Update status

// Get one update status
// Parameter: the updateId got after an asynchronous request (e.g. documents addition)
update, err := client.Updates("books").Get(1)
// Get all update satus
list, err := client.Updates("books").List()
resp, err := client.Search(indexUID).Search(meilisearch.SearchRequest{
    Query: "prince",
    Limit: 10,
})
{
    "hits": [
        {
            "book_id": 456,
            "title": "Le Petit Prince"
        },
        {
            "book_id": 4,
            "title": "Harry Potter and the Half-Blood Prince"
        }
    ],
    "offset": 0,
    "limit": 20,
    "processingTimeMs": 13,
    "query": "prince"
}

All the supported options are described in this documentation section.

resp, err := client.Search(indexUID).Search(meilisearch.SearchRequest{
    Query: "harry pottre",
    AttributesToHighlight: []string{"*"},
})
{
    "hits": [
        {
            "book_id": 456,
            "title": "Le Petit Prince",
            "_formatted": {
                "book_id": 456,
                "title": "Le Petit <em>Prince</em>"
            }
        }
    ],
    "offset": 0,
    "limit": 1,
    "processingTimeMs": 0,
    "query": "prince"
}

βš™οΈ Development Workflow

If you want to contribute, this section describes the steps to follow.

Thank you for your interest in a MeiliSearch tool! β™₯️

Install Go

Follow the official tutorial

Install dependencies

$ go get -v -t -d ./...

Tests and Linter

Each PR should pass the tests and the linter to be accepted.

# Tests
$ ./run_tests.sh
# Install golint if needed (see comment below)
$ go get -u golang.org/x/lint/golint
# Use golint
$ golint
# Use gofmt
$ gofmt -w ./..

To find out where golint was installed you can run go list -f {{.Target}} golang.org/x/lint/golint. For golint to be used globally add that directory to the $PATH environment setting (taken from golint docs)


MeiliSearch provides and maintains many SDKs and Integration tools like this one. We want to provide everyone with an amazing search experience for any kind of project. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the integration-guides repository.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

This section is empty.

Functions ΒΆ

This section is empty.

Types ΒΆ

type APIDocuments ΒΆ added in v0.9.0

type APIDocuments interface {

	// Get one document using its unique identifier.
	// documentPtr should be a pointer.
	Get(identifier string, documentPtr interface{}) error

	// Delete one document based on its unique identifier.
	Delete(identifier string) (*AsyncUpdateID, error)

	// Delete a selection of documents based on array of identifiers.
	Deletes(identifier []string) (*AsyncUpdateID, error)

	// List the documents in an unordered way.
	List(request ListDocumentsRequest, documentsPtr interface{}) error

	// AddOrReplace a list of documents, replace them if they already exist based on their unique identifiers.
	AddOrReplace(documentsPtr interface{}) (*AsyncUpdateID, error)

	// AddOrReplaceWithPrimaryKey do the same as AddOrReplace but will specify during the update to primaryKey to use for indexing
	AddOrReplaceWithPrimaryKey(documentsPtr interface{}, primaryKey string) (resp *AsyncUpdateID, err error)

	// AddOrUpdate a list of documents, update them if they already exist based on their unique identifiers.
	AddOrUpdate(documentsPtr interface{}) (*AsyncUpdateID, error)

	// AddOrUpdateWithPrimaryKey do the same as AddOrUpdate but will specify during the update to primaryKey to use for indexing
	AddOrUpdateWithPrimaryKey(documentsPtr interface{}, primaryKey string) (resp *AsyncUpdateID, err error)

	// DeleteAllDocuments in the specified index.
	DeleteAllDocuments() (*AsyncUpdateID, error)

	APIWithIndexID
}

APIDocuments are objects composed of fields containing any data.

Documentation: https://docs.meilisearch.com/references/documents.html

type APIHealth ΒΆ added in v0.9.0

type APIHealth interface {

	// Get health of MeiliSearch server.
	Get() error

	// Update health of MeiliSearch server.
	Update(health bool) error
}

APIHealth handle health of a MeiliSearch server.

Documentation: https://docs.meilisearch.com/references/health.html

type APIIndexes ΒΆ added in v0.9.0

type APIIndexes interface {

	// Get the index relative information.
	Get(uid string) (*Index, error)

	// List all indexes.
	List() ([]Index, error)

	// Create an index.
	// If no UID is specified in the request a randomly generated UID will be returned.
	// It's associated to the new index. This UID will be essential to make all request over the created index.
	// You can define your primary key during the index creation
	Create(request CreateIndexRequest) (*CreateIndexResponse, error)

	// Update an index name.
	UpdateName(uid string, name string) (*Index, error)

	// Update an index primary key.
	UpdatePrimaryKey(uid string, primaryKey string) (*Index, error)

	// Delete an index.
	Delete(uid string) (bool, error)
}

APIIndexes index is an entity, like a table in SQL, with a specific schema definition. It gathers a collection of documents with the structure defined by the schema. An index is defined by an unique identifier uid that is generated by MeiliSearch (if none is given) on index creation. It also has a name to help you track your different indexes.

Documentation: https://docs.meilisearch.com/references/indexes.html

type APIKeys ΒΆ added in v0.9.0

type APIKeys interface {

	// Get all keys.
	Get() (*Keys, error)
}

APIKeys To communicate with MeiliSearch's RESTfull API most of the routes require an API key.

Documentation: https://docs.meilisearch.com/references/keys.html

type APISearch ΒΆ added in v0.9.0

type APISearch interface {

	// Search for documents matching a specific query in the given index.
	Search(params SearchRequest) (*SearchResponse, error)

	APIWithIndexID
}

APISearch search through documents list in an index.

Documentation: https://docs.meilisearch.com/references/search.html

type APISettings ΒΆ added in v0.9.0

type APISettings interface {
	GetAll() (*Settings, error)

	UpdateAll(request Settings) (*AsyncUpdateID, error)

	ResetAll() (*AsyncUpdateID, error)

	GetRankingRules() (*[]string, error)

	UpdateRankingRules([]string) (*AsyncUpdateID, error)

	ResetRankingRules() (*AsyncUpdateID, error)

	GetDistinctAttribute() (*string, error)

	UpdateDistinctAttribute(string) (*AsyncUpdateID, error)

	ResetDistinctAttribute() (*AsyncUpdateID, error)

	GetSearchableAttributes() (*[]string, error)

	UpdateSearchableAttributes([]string) (*AsyncUpdateID, error)

	ResetSearchableAttributes() (*AsyncUpdateID, error)

	GetDisplayedAttributes() (*[]string, error)

	UpdateDisplayedAttributes([]string) (*AsyncUpdateID, error)

	ResetDisplayedAttributes() (*AsyncUpdateID, error)

	GetStopWords() (*[]string, error)

	UpdateStopWords([]string) (*AsyncUpdateID, error)

	ResetStopWords() (*AsyncUpdateID, error)

	GetSynonyms() (*map[string][]string, error)

	UpdateSynonyms(map[string][]string) (*AsyncUpdateID, error)

	ResetSynonyms() (*AsyncUpdateID, error)

	GetAcceptNewFields() (*bool, error)

	UpdateAcceptNewFields(bool) (*AsyncUpdateID, error)

	GetAttributesForFaceting() (*[]string, error)

	UpdateAttributesForFaceting([]string) (*AsyncUpdateID, error)

	ResetAttributesForFaceting() (*AsyncUpdateID, error)
}

APISettings allow to configure the MeiliSearch indexing & search behaviour.

Documentation: https://docs.meilisearch.com/references/settings.html

type APIStats ΒΆ added in v0.9.0

type APIStats interface {

	// Get stats of an index.
	Get(indexUID string) (*StatsIndex, error)

	GetAll() (*Stats, error)
}

APIStats retrieve statistic over all indexes or a specific index id.

Documentation: https://docs.meilisearch.com/references/stats.html

type APISystemInformation ΒΆ added in v0.9.0

type APISystemInformation interface {
	Get() (*SystemInformation, error)
	GetPretty() (*SystemInformationPretty, error)
}

APISystemInformation retrieve information about the MeiliSearch consuption

Documentation: https://docs.meilisearch.com/references/sys-info.html

type APIUpdates ΒΆ added in v0.9.0

type APIUpdates interface {

	// Get the status of an update in a given index.
	Get(id int64) (*Update, error)

	// Get the status of all updates in a given index.
	List() ([]Update, error)

	APIWithIndexID
}

APIUpdates MeiliSearch is an asynchronous API. It means that the API does not behave as you would typically expect when handling the request's responses.

Some actions are put in a queue and will be executed in turn (asynchronously). In this case, the server response contains the identifier to track the execution of the action.

This API permit to get the state of an update id.

Documentation: https://docs.meilisearch.com/references/updates.html

type APIVersion ΒΆ added in v0.9.0

type APIVersion interface {

	// Get version of MeiliSearch.
	Get() (*Version, error)
}

APIVersion retrieve the version of MeiliSearch.

Documentation: https://docs.meilisearch.com/references/version.html

type APIWithIndexID ΒΆ added in v0.9.0

type APIWithIndexID interface {
	IndexID() string
	Client() *Client
}

APIWithIndexID is used to await an async update id response. Each apis that use an index internally implement this interface except APIUpdates.

type AsyncUpdateID ΒΆ added in v0.9.0

type AsyncUpdateID struct {
	UpdateID int64 `json:"updateID"`
}

AsyncUpdateID is returned for asynchronous method

Documentation: https://docs.meilisearch.com/guides/advanced_guides/asynchronous_updates.html

type Client ΒΆ

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

Client is a structure that give you the power for interacting with an high-level api with meilisearch.

func NewClient ΒΆ

func NewClient(config Config) *Client

NewClient create a Client from a Config structure.

func NewClientWithCustomHTTPClient ΒΆ added in v0.9.0

func NewClientWithCustomHTTPClient(config Config, client http.Client) *Client

NewClientWithCustomHTTPClient create a Client from a Config structure and a http.Client which you can customize.

func (Client) DefaultWaitForPendingUpdate ΒΆ added in v0.9.1

func (c Client) DefaultWaitForPendingUpdate(indexUID string, updateID *AsyncUpdateID) (UpdateStatus, error)

DefaultWaitForPendingUpdate checks each 50ms the status of a WaitForPendingUpdate. This is a default implementation of WaitForPendingUpdate.

func (*Client) Documents ΒΆ

func (c *Client) Documents(indexID string) APIDocuments

Documents return an APIDocuments client.

func (*Client) Health ΒΆ

func (c *Client) Health() APIHealth

Health return an APIHealth client.

func (*Client) Indexes ΒΆ

func (c *Client) Indexes() APIIndexes

Indexes return an APIIndexes client.

func (*Client) Keys ΒΆ

func (c *Client) Keys() APIKeys

Keys return an APIKeys client.

func (*Client) Search ΒΆ

func (c *Client) Search(indexID string) APISearch

Search return an APISearch client.

func (*Client) Settings ΒΆ added in v0.9.0

func (c *Client) Settings(indexID string) APISettings

Settings return an APISettings client.

func (*Client) Stats ΒΆ

func (c *Client) Stats() APIStats

Stats return an APIStats client.

func (*Client) Updates ΒΆ

func (c *Client) Updates(indexID string) APIUpdates

Updates return an APIUpdates client.

func (*Client) Version ΒΆ

func (c *Client) Version() APIVersion

Version return an APIVersion client.

func (Client) WaitForPendingUpdate ΒΆ added in v0.9.1

func (c Client) WaitForPendingUpdate(
	ctx context.Context,
	interval time.Duration,
	indexID string,
	updateID *AsyncUpdateID) (UpdateStatus, error)

WaitForPendingUpdate waits for the end of an update. The function will check by regular interval provided in parameter interval the UpdateStatus. If it is not UpdateStatusEnqueued or the ctx cancelled we return the UpdateStatus.

type Config ΒΆ

type Config struct {

	// Host is the host of your meilisearch database
	// Example: 'http://localhost:7700'
	Host string

	// APIKey is optional
	APIKey string
}

Config configure the Client

type CreateIndexRequest ΒΆ

type CreateIndexRequest struct {
	Name       string `json:"name,omitempty"`
	UID        string `json:"uid,omitempty"`
	PrimaryKey string `json:"primaryKey,omitempty"`
}

CreateIndexRequest is the request body for create index method

type CreateIndexResponse ΒΆ

type CreateIndexResponse struct {
	Name       string    `json:"name"`
	UID        string    `json:"uid"`
	UpdateID   int64     `json:"updateID,omitempty"`
	CreatedAt  time.Time `json:"createdAt"`
	UpdatedAt  time.Time `json:"updatedAt"`
	PrimaryKey string    `json:"primaryKey,omitempty"`
}

CreateIndexResponse is the response body for create index method

type ErrCode ΒΆ

type ErrCode int

ErrCode are all possible errors found during requests

const (
	// ErrCodeUnknown default error code, undefined
	ErrCodeUnknown ErrCode = 0
	// ErrCodeMarshalRequest impossible to serialize request body
	ErrCodeMarshalRequest ErrCode = iota + 1
	// ErrCodeRequestCreation impossible create a request
	ErrCodeRequestCreation
	// ErrCodeRequestExecution impossible execute a request
	ErrCodeRequestExecution
	// ErrCodeResponseStatusCode the response status code is not conform
	ErrCodeResponseStatusCode
	// ErrCodeResponseReadBody impossible to read the response body
	ErrCodeResponseReadBody
	// ErrCodeResponseUnmarshalBody impossible deserialize the response body
	ErrCodeResponseUnmarshalBody
	// ErrCodeURLParsing impossible to parse url parameters
	ErrCodeURLParsing
)

type Error ΒΆ

type Error struct {
	// Endpoint is the path of the request (host is not in)
	Endpoint string

	// Method is the HTTP verb of the request
	Method string

	// Function name used
	Function string

	// APIName is which part/module of the api
	APIName string

	// RequestToString is the raw request into string ('empty request' if not present)
	RequestToString string

	// RequestToString is the raw request into string ('empty response' if not present)
	ResponseToString string

	// MeilisearchMessage is the raw request into string ('empty meilisearch message' if not present)
	MeilisearchMessage string

	// StatusCode of the request
	StatusCode int

	// StatusCode expected by the endpoint to be considered as a success
	StatusCodeExpected []int

	// OriginError is the origin error that produce the current Error. It can be nil in case of a bad status code.
	OriginError error

	// ErrCode is the internal error code that represent the different step when executing a request that can produce
	// an error.
	ErrCode ErrCode
	// contains filtered or unexported fields
}

Error is the internal error structure that all exposed method use. So ALL errors returned by this library can be cast to this struct (as a pointer)

func (Error) Error ΒΆ

func (e Error) Error() string

Error return a well human formatted message.

func (*Error) ErrorBody ΒΆ

func (e *Error) ErrorBody(body []byte)

ErrorBody add a body to an error

func (*Error) WithErrCode ΒΆ

func (e *Error) WithErrCode(err ErrCode, errs ...error) *Error

WithErrCode add an error code to an error

func (*Error) WithMessage ΒΆ

func (e *Error) WithMessage(str string, errs ...error) *Error

WithMessage add a message to an error

type Index ΒΆ

type Index struct {
	Name       string    `json:"name"`
	UID        string    `json:"uid"`
	CreatedAt  time.Time `json:"createdAt"`
	UpdatedAt  time.Time `json:"updatedAt"`
	PrimaryKey string    `json:"primaryKey,omitempty"`
}

Index is the type that represent an index in MeiliSearch

type Keys ΒΆ added in v0.9.0

type Keys struct {
	Public  string `json:"public,omitempty"`
	Private string `json:"private,omitempty"`
}

Keys allow the user to connect to the MeiliSearch instance

Documentation: https://docs.meilisearch.com/guides/advanced_guides/asynchronous_updates.html

type ListDocumentsRequest ΒΆ

type ListDocumentsRequest struct {
	Offset               int64    `json:"offset,omitempty"`
	Limit                int64    `json:"limit,omitempty"`
	AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"`
}

ListDocumentsRequest is the request body for list documents method

type SearchRequest ΒΆ

type SearchRequest struct {
	Query                 string
	Offset                int64
	Limit                 int64
	AttributesToRetrieve  []string
	AttributesToCrop      []string
	CropLength            int64
	AttributesToHighlight []string
	Filters               string
	Matches               bool
	FacetsDistribution    []string
	FacetFilters          interface{}
}

SearchRequest is the request url param needed for a search query. This struct will be converted to url param before sent.

Documentation: https://docs.meilisearch.com/guides/advanced_guides/search_parameters.html

type SearchResponse ΒΆ

type SearchResponse struct {
	Hits                  []interface{} `json:"hits"`
	NbHits                int64         `json:"nbHits"`
	Offset                int64         `json:"offset"`
	Limit                 int64         `json:"limit"`
	ProcessingTimeMs      int64         `json:"processingTimeMs"`
	Query                 string        `json:"query"`
	FacetsDistribution    interface{}   `json:"facetsDistribution,omitempty"`
	ExhaustiveFacetsCount interface{}   `json:"exhaustiveFacetsCount,omitempty"`
}

SearchResponse is the response body for search method

type Settings ΒΆ

type Settings struct {
	RankingRules          []string            `json:"rankingRules,omitempty"`
	DistinctAttribute     *string             `json:"distinctAttribute,omitempty"`
	SearchableAttributes  []string            `json:"searchableAttributes,omitempty"`
	DisplayedAttributes   []string            `json:"displayedAttributes,omitempty"`
	StopWords             []string            `json:"stopWords,omitempty"`
	Synonyms              map[string][]string `json:"synonyms,omitempty"`
	AcceptNewFields       bool                `json:"acceptNewFields,omitempty"`
	AttributesForFaceting []string            `json:"attributesForFaceting,omitempty"`
}

Settings is the type that represents the settings in MeiliSearch

type Stats ΒΆ

type Stats struct {
	DatabaseSize int64                 `json:"database_size"`
	LastUpdate   time.Time             `json:"last_update"`
	Indexes      map[string]StatsIndex `json:"indexes"`
}

Stats is the type that represent all stats

type StatsIndex ΒΆ added in v0.9.1

type StatsIndex struct {
	NumberOfDocuments int64            `json:"numberOfDocuments"`
	IsIndexing        bool             `json:"isIndexing"`
	FieldsFrequency   map[string]int64 `json:"fieldsFrequency"`
}

StatsIndex is the type that represent the stats of an index in MeiliSearch

type SystemInformation ΒΆ

type SystemInformation struct {
	MemoryUsage    float64   `json:"memoryUsage"`
	ProcessorUsage []float64 `json:"processorUsage"`
	Global         struct {
		TotalMemory int64 `json:"totalMemory"`
		UsedMemory  int64 `json:"usedMemory"`
		UsedSwap    int64 `json:"usedSwap"`
		InputData   int64 `json:"inputData"`
		OutputData  int64 `json:"outputData"`
	} `json:"global"`
	Process struct {
		Memory int64 `json:"memory"`
		CPU    int64 `json:"cpu"`
	} `json:"process"`
}

SystemInformation is the type that represent the information system in MeiliSearch

type SystemInformationPretty ΒΆ

type SystemInformationPretty struct {
	MemoryUsage    string   `json:"memoryUsage"`
	ProcessorUsage []string `json:"processorUsage"`
	Global         struct {
		TotalMemory string `json:"totalMemory"`
		UsedMemory  string `json:"usedMemory"`
		UsedSwap    string `json:"usedSwap"`
		InputData   string `json:"inputData"`
		OutputData  string `json:"outputData"`
	} `json:"global"`
	Process struct {
		Memory string `json:"memory"`
		CPU    string `json:"cpu"`
	} `json:"process"`
}

SystemInformationPretty is the type that represent the information system (human readable) in MeiliSearch

type Unknown ΒΆ

type Unknown map[string]interface{}

Unknown is unknown json type

type Update ΒΆ

type Update struct {
	Status      UpdateStatus `json:"status"`
	UpdateID    int64        `json:"updateID"`
	Type        Unknown      `json:"type"`
	Error       string       `json:"error"`
	EnqueuedAt  time.Time    `json:"enqueuedAt"`
	ProcessedAt time.Time    `json:"processedAt"`
}

Update indicate information about an update

type UpdateStatus ΒΆ

type UpdateStatus string

UpdateStatus is the status of an update.

const (
	// UpdateStatusUnknown is the default UpdateStatus, should not exist
	UpdateStatusUnknown UpdateStatus = "unknown"
	// UpdateStatusEnqueued means the server know the update but didn't handle it yet
	UpdateStatusEnqueued UpdateStatus = "enqueued"
	// UpdateStatusProcessed means the server has processed the update and all went well
	UpdateStatusProcessed UpdateStatus = "processed"
	// UpdateStatusFailed means the server has processed the update and an error has been reported
	UpdateStatusFailed UpdateStatus = "failed"
)

type Version ΒΆ

type Version struct {
	CommitSha  string    `json:"commitSha"`
	BuildDate  time.Time `json:"buildDate"`
	PkgVersion string    `json:"pkgVersion"`
}

Version is the type that represents the versions in MeiliSearch

Jump to

Keyboard shortcuts

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