Documentation
ΒΆ
Index ΒΆ
- type APIDocuments
- type APIHealth
- type APIIndexes
- type APIKeys
- type APISearch
- type APISettings
- type APIStats
- type APIUpdates
- type APIVersion
- type APIWithIndexID
- type AsyncUpdateID
- type Client
- func (c Client) DefaultWaitForPendingUpdate(indexUID string, updateID *AsyncUpdateID) (UpdateStatus, error)
- func (c *Client) Documents(indexID string) APIDocuments
- func (c *Client) Health() APIHealth
- func (c *Client) Indexes() APIIndexes
- func (c *Client) Keys() APIKeys
- func (c *Client) Search(indexID string) APISearch
- func (c *Client) Settings(indexID string) APISettings
- func (c *Client) Stats() APIStats
- func (c *Client) Updates(indexID string) APIUpdates
- func (c *Client) Version() APIVersion
- func (c Client) WaitForPendingUpdate(ctx context.Context, interval time.Duration, indexID string, ...) (UpdateStatus, error)
- type ClientInterface
- type Config
- type CreateIndexRequest
- type CreateIndexResponse
- type ErrCode
- type Error
- type Health
- type Index
- type Keys
- type ListDocumentsRequest
- type Name
- type PrimaryKey
- type RawType
- type SearchRequest
- type SearchResponse
- type Settings
- type Stats
- type StatsIndex
- type Unknown
- type Update
- type UpdateStatus
- type Version
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
}
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
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(arr []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(synonyms map[string][]string) (*AsyncUpdateID, error)
ResetSynonyms() (*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 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
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() ClientInterface
}
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
func (AsyncUpdateID) MarshalEasyJSON ΒΆ added in v0.13.1
func (v AsyncUpdateID) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AsyncUpdateID) MarshalJSON ΒΆ added in v0.13.1
func (v AsyncUpdateID) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AsyncUpdateID) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *AsyncUpdateID) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AsyncUpdateID) UnmarshalJSON ΒΆ added in v0.13.1
func (v *AsyncUpdateID) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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 (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) Indexes ΒΆ
func (c *Client) Indexes() APIIndexes
Indexes return an APIIndexes client.
func (*Client) Settings ΒΆ added in v0.9.0
func (c *Client) Settings(indexID string) APISettings
Settings return an APISettings 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 ClientInterface ΒΆ added in v0.13.1
type ClientInterface interface {
WaitForPendingUpdate(ctx context.Context, interval time.Duration, indexID string, updateID *AsyncUpdateID) (UpdateStatus, error)
DefaultWaitForPendingUpdate(indexUID string, updateID *AsyncUpdateID) (UpdateStatus, error)
Indexes() APIIndexes
Version() APIVersion
Documents(indexID string) APIDocuments
Search(indexID string) APISearch
Updates(indexID string) APIUpdates
Settings(indexID string) APISettings
Keys() APIKeys
Stats() APIStats
Health() APIHealth
}
ClientInterface is interface for all Meilisearch client
func NewClient ΒΆ
func NewClient(config Config) ClientInterface
NewClient creates Meilisearch with default fasthttp.Client
func NewFastHTTPCustomClient ΒΆ added in v0.13.1
func NewFastHTTPCustomClient(config Config, client *fasthttp.Client) ClientInterface
NewFastHTTPCustomClient creates Meilisearch with custom fasthttp.Client
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
func (CreateIndexRequest) MarshalEasyJSON ΒΆ added in v0.13.1
func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateIndexRequest) MarshalJSON ΒΆ added in v0.13.1
func (v CreateIndexRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateIndexRequest) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateIndexRequest) UnmarshalJSON ΒΆ added in v0.13.1
func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (CreateIndexResponse) MarshalEasyJSON ΒΆ added in v0.13.1
func (v CreateIndexResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateIndexResponse) MarshalJSON ΒΆ added in v0.13.1
func (v CreateIndexResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateIndexResponse) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *CreateIndexResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateIndexResponse) UnmarshalJSON ΒΆ added in v0.13.1
func (v *CreateIndexResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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) WithErrCode ΒΆ
WithErrCode add an error code to an error
type Health ΒΆ added in v0.13.1
type Health struct {
Health bool `json:"health"`
}
Health is the request body for set Meilisearch health
func (Health) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Health) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Health) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Health) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
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
func (Index) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Index) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Index) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Index) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
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
func (Keys) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Keys) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Keys) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Keys) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
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
func (ListDocumentsRequest) MarshalEasyJSON ΒΆ added in v0.13.1
func (v ListDocumentsRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ListDocumentsRequest) MarshalJSON ΒΆ added in v0.13.1
func (v ListDocumentsRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ListDocumentsRequest) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *ListDocumentsRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ListDocumentsRequest) UnmarshalJSON ΒΆ added in v0.13.1
func (v *ListDocumentsRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Name ΒΆ added in v0.13.1
type Name struct {
Name string `json:"name"`
}
Name is the request body for set Index name
func (Name) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Name) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Name) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Name) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
type PrimaryKey ΒΆ added in v0.13.1
type PrimaryKey struct {
PrimaryKey string `json:"primaryKey"`
}
PrimaryKey is the request body for set Index primary key
func (PrimaryKey) MarshalEasyJSON ΒΆ added in v0.13.1
func (v PrimaryKey) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PrimaryKey) MarshalJSON ΒΆ added in v0.13.1
func (v PrimaryKey) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PrimaryKey) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *PrimaryKey) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PrimaryKey) UnmarshalJSON ΒΆ added in v0.13.1
func (v *PrimaryKey) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type RawType ΒΆ added in v0.13.1
type RawType []byte
RawType is an alias for raw byte[]
func (RawType) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*RawType) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
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{}
PlaceholderSearch bool
}
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
func (SearchRequest) MarshalEasyJSON ΒΆ added in v0.13.1
func (v SearchRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchRequest) MarshalJSON ΒΆ added in v0.13.1
func (v SearchRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchRequest) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *SearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchRequest) UnmarshalJSON ΒΆ added in v0.13.1
func (v *SearchRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (SearchResponse) MarshalEasyJSON ΒΆ added in v0.13.1
func (v SearchResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchResponse) MarshalJSON ΒΆ added in v0.13.1
func (v SearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchResponse) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *SearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchResponse) UnmarshalJSON ΒΆ added in v0.13.1
func (v *SearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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"`
AttributesForFaceting []string `json:"attributesForFaceting,omitempty"`
}
Settings is the type that represents the settings in MeiliSearch
func (Settings) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Settings) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Settings) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Settings) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
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
func (Stats) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Stats) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Stats) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Stats) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
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
func (StatsIndex) MarshalEasyJSON ΒΆ added in v0.13.1
func (v StatsIndex) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StatsIndex) MarshalJSON ΒΆ added in v0.13.1
func (v StatsIndex) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StatsIndex) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *StatsIndex) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StatsIndex) UnmarshalJSON ΒΆ added in v0.13.1
func (v *StatsIndex) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (Update) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Update) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Update) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Update) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
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
func (Version) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Version) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Version) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Version) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface