Documentation
ΒΆ
Overview ΒΆ
Package meilisearch is the official Meilisearch SDK for the Go programming language.
The meilisearch-go SDK for Go provides APIs and utilities that developers can use to build Go applications that use meilisearch service.
See the meilisearch package documentation for more information. https://www.meilisearch.com/docs/reference
Example: meili := New("http://localhost:7700", WithAPIKey("foobar")) idx := meili.Index("movies") documents := []map[string]interface{}{ {"id": 1, "title": "Carol", "genres": []string{"Romance", "Drama"}}, {"id": 2, "title": "Wonder Woman", "genres": []string{"Action", "Adventure"}}, {"id": 3, "title": "Life of Pi", "genres": []string{"Adventure", "Drama"}}, {"id": 4, "title": "Mad Max: Fury Road", "genres": []string{"Adventure", "Science Fiction"}}, {"id": 5, "title": "Moana", "genres": []string{"Fantasy", "Action"}}, {"id": 6, "title": "Philadelphia", "genres": []string{"Drama"}}, } task, err := idx.AddDocuments(documents) if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(task.TaskUID)
Index ΒΆ
- Constants
- Variables
- func GetQualifiedVersion() (qualifiedVersion string)
- func IsValidUUID(uuid string) bool
- func VersionErrorHintMessage(err error, req *internalRequest) error
- type CancelTasksQuery
- type ContentEncoding
- type CreateIndexRequest
- type CsvDocumentsQuery
- type DeleteTasksQuery
- type Details
- type Distribution
- type DocumentManager
- type DocumentQuery
- type DocumentReader
- type DocumentsQuery
- type DocumentsResult
- type Embedder
- type EncodingCompressionLevel
- type ErrCode
- type Error
- type ExperimentalFeatures
- func (ef *ExperimentalFeatures) Get() (*ExperimentalFeaturesResult, error)
- func (ef *ExperimentalFeatures) GetWithContext(ctx context.Context) (*ExperimentalFeaturesResult, error)
- func (ef *ExperimentalFeatures) SetContainsFilter(containsFilter bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetEditDocumentsByFunction(editDocumentsByFunction bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetLogsRoute(logsRoute bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetMetrics(metrics bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) Update() (*ExperimentalFeaturesResult, error)
- func (ef *ExperimentalFeatures) UpdateWithContext(ctx context.Context) (*ExperimentalFeaturesResult, error)
- type ExperimentalFeaturesBase
- type ExperimentalFeaturesResult
- type FacetSearchRequest
- type FacetSearchResponse
- type Faceting
- type Health
- type IndexConfig
- type IndexManager
- type IndexReader
- type IndexResult
- type IndexesQuery
- type IndexesResults
- type Key
- type KeyManager
- type KeyParsed
- type KeyReader
- type KeyUpdate
- type KeysQuery
- type KeysResults
- type LocalizedAttributes
- type MatchingStrategy
- type MinWordSizeForTypos
- type MultiSearchFederation
- type MultiSearchRequest
- type MultiSearchResponse
- type Option
- func DisableRetries() Option
- func WithAPIKey(key string) Option
- func WithContentEncoding(encodingType ContentEncoding, level EncodingCompressionLevel) Option
- func WithCustomClient(client *http.Client) Option
- func WithCustomClientWithTLS(tlsConfig *tls.Config) Option
- func WithCustomRetries(retryOnStatus []int, maxRetries uint8) Option
- type Pagination
- type ProximityPrecisionType
- type RawType
- type SearchFederationOptions
- type SearchReader
- type SearchRequest
- type SearchRequestHybrid
- type SearchResponse
- type ServiceManager
- type ServiceReader
- type Settings
- type SettingsManager
- type SettingsReader
- type SimilarDocumentQuery
- type SimilarDocumentResult
- type SortFacetType
- type Stats
- type StatsIndex
- type SwapIndexesParams
- type Task
- type TaskInfo
- type TaskManager
- type TaskReader
- type TaskResult
- type TaskStatus
- type TaskType
- type TasksQuery
- type TenantTokenClaims
- type TenantTokenOptions
- type TypoTolerance
- type Unknown
- type UpdateDocumentByFunctionRequest
- type UpdateIndexRequest
- type Version
Examples ΒΆ
Constants ΒΆ
const ( DefaultLimit int64 = 20 GzipEncoding ContentEncoding = "gzip" DeflateEncoding ContentEncoding = "deflate" BrotliEncoding ContentEncoding = "br" NoCompression EncodingCompressionLevel = 0 BestSpeed EncodingCompressionLevel = 1 BestCompression EncodingCompressionLevel = 9 DefaultCompression EncodingCompressionLevel = -1 HuffmanOnlyCompression EncodingCompressionLevel = -2 ConstantCompression EncodingCompressionLevel = -2 StatelessCompression EncodingCompressionLevel = -3 )
const VERSION = "0.31.0"
Variables ΒΆ
var ( ErrInvalidRequestMethod = errors.New("request body is not expected for GET and HEAD requests") ErrRequestBodyWithoutContentType = errors.New("request body without Content-Type is not allowed") ErrNoSearchRequest = errors.New("no search request provided") ErrNoFacetSearchRequest = errors.New("no search facet request provided") ErrConnectingFailed = errors.New("meilisearch is not connected") )
General errors
Functions ΒΆ
func GetQualifiedVersion ΒΆ
func GetQualifiedVersion() (qualifiedVersion string)
func IsValidUUID ΒΆ
func VersionErrorHintMessage ΒΆ
VersionErrorHintMessage a hint to the error message if it may come from a version incompatibility with meilisearch
Types ΒΆ
type CancelTasksQuery ΒΆ
type CancelTasksQuery struct { UIDS []int64 IndexUIDS []string Statuses []TaskStatus Types []TaskType BeforeEnqueuedAt time.Time AfterEnqueuedAt time.Time BeforeStartedAt time.Time AfterStartedAt time.Time }
CancelTasksQuery is a list of filter available to send as query parameters
func (CancelTasksQuery) MarshalEasyJSON ΒΆ
func (v CancelTasksQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelTasksQuery) MarshalJSON ΒΆ
func (v CancelTasksQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelTasksQuery) UnmarshalEasyJSON ΒΆ
func (v *CancelTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelTasksQuery) UnmarshalJSON ΒΆ
func (v *CancelTasksQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ContentEncoding ΒΆ
type ContentEncoding string
func (ContentEncoding) IsZero ΒΆ
func (c ContentEncoding) IsZero() bool
func (ContentEncoding) String ΒΆ
func (c ContentEncoding) String() string
type CreateIndexRequest ΒΆ
type CreateIndexRequest struct { UID string `json:"uid,omitempty"` PrimaryKey string `json:"primaryKey,omitempty"` }
CreateIndexRequest is the request body for create index method
func (CreateIndexRequest) MarshalEasyJSON ΒΆ
func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateIndexRequest) MarshalJSON ΒΆ
func (v CreateIndexRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateIndexRequest) UnmarshalEasyJSON ΒΆ
func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateIndexRequest) UnmarshalJSON ΒΆ
func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CsvDocumentsQuery ΒΆ
type CsvDocumentsQuery struct { PrimaryKey string `json:"primaryKey,omitempty"` CsvDelimiter string `json:"csvDelimiter,omitempty"` }
func (CsvDocumentsQuery) MarshalEasyJSON ΒΆ
func (v CsvDocumentsQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CsvDocumentsQuery) MarshalJSON ΒΆ
func (v CsvDocumentsQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CsvDocumentsQuery) UnmarshalEasyJSON ΒΆ
func (v *CsvDocumentsQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CsvDocumentsQuery) UnmarshalJSON ΒΆ
func (v *CsvDocumentsQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DeleteTasksQuery ΒΆ
type DeleteTasksQuery struct { UIDS []int64 IndexUIDS []string Statuses []TaskStatus Types []TaskType CanceledBy []int64 BeforeEnqueuedAt time.Time AfterEnqueuedAt time.Time BeforeStartedAt time.Time AfterStartedAt time.Time BeforeFinishedAt time.Time AfterFinishedAt time.Time }
DeleteTasksQuery is a list of filter available to send as query parameters
func (DeleteTasksQuery) MarshalEasyJSON ΒΆ
func (v DeleteTasksQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DeleteTasksQuery) MarshalJSON ΒΆ
func (v DeleteTasksQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DeleteTasksQuery) UnmarshalEasyJSON ΒΆ
func (v *DeleteTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DeleteTasksQuery) UnmarshalJSON ΒΆ
func (v *DeleteTasksQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Details ΒΆ
type Details struct { ReceivedDocuments int64 `json:"receivedDocuments,omitempty"` IndexedDocuments int64 `json:"indexedDocuments,omitempty"` DeletedDocuments int64 `json:"deletedDocuments,omitempty"` PrimaryKey string `json:"primaryKey,omitempty"` ProvidedIds int64 `json:"providedIds,omitempty"` 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"` FilterableAttributes []string `json:"filterableAttributes,omitempty"` SortableAttributes []string `json:"sortableAttributes,omitempty"` TypoTolerance *TypoTolerance `json:"typoTolerance,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` Faceting *Faceting `json:"faceting,omitempty"` MatchedTasks int64 `json:"matchedTasks,omitempty"` CanceledTasks int64 `json:"canceledTasks,omitempty"` DeletedTasks int64 `json:"deletedTasks,omitempty"` OriginalFilter string `json:"originalFilter,omitempty"` Swaps []SwapIndexesParams `json:"swaps,omitempty"` DumpUid string `json:"dumpUid,omitempty"` }
func (Details) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Details) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Details) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Details) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type Distribution ΒΆ
type Distribution struct { Mean float64 `json:"mean"` // Mean of the distribution Sigma float64 `json:"sigma"` // Sigma (standard deviation) of the distribution }
Distribution represents a statistical distribution with mean and standard deviation (sigma).
func (Distribution) MarshalEasyJSON ΒΆ
func (v Distribution) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Distribution) MarshalJSON ΒΆ
func (v Distribution) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Distribution) UnmarshalEasyJSON ΒΆ
func (v *Distribution) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Distribution) UnmarshalJSON ΒΆ
func (v *Distribution) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DocumentManager ΒΆ
type DocumentManager interface { DocumentReader // AddDocuments adds multiple documents to the index. AddDocuments(documentsPtr interface{}, primaryKey ...string) (*TaskInfo, error) // AddDocumentsWithContext adds multiple documents to the index using the provided context for cancellation. AddDocumentsWithContext(ctx context.Context, documentsPtr interface{}, primaryKey ...string) (*TaskInfo, error) // AddDocumentsInBatches adds documents to the index in batches of specified size. AddDocumentsInBatches(documentsPtr interface{}, batchSize int, primaryKey ...string) ([]TaskInfo, error) // AddDocumentsInBatchesWithContext adds documents to the index in batches of specified size using the provided context for cancellation. AddDocumentsInBatchesWithContext(ctx context.Context, documentsPtr interface{}, batchSize int, primaryKey ...string) ([]TaskInfo, error) // AddDocumentsCsv adds documents from a CSV byte array to the index. AddDocumentsCsv(documents []byte, options *CsvDocumentsQuery) (*TaskInfo, error) // AddDocumentsCsvWithContext adds documents from a CSV byte array to the index using the provided context for cancellation. AddDocumentsCsvWithContext(ctx context.Context, documents []byte, options *CsvDocumentsQuery) (*TaskInfo, error) // AddDocumentsCsvInBatches adds documents from a CSV byte array to the index in batches of specified size. AddDocumentsCsvInBatches(documents []byte, batchSize int, options *CsvDocumentsQuery) ([]TaskInfo, error) // AddDocumentsCsvInBatchesWithContext adds documents from a CSV byte array to the index in batches of specified size using the provided context for cancellation. AddDocumentsCsvInBatchesWithContext(ctx context.Context, documents []byte, batchSize int, options *CsvDocumentsQuery) ([]TaskInfo, error) // AddDocumentsCsvFromReaderInBatches adds documents from a CSV reader to the index in batches of specified size. AddDocumentsCsvFromReaderInBatches(documents io.Reader, batchSize int, options *CsvDocumentsQuery) ([]TaskInfo, error) // AddDocumentsCsvFromReaderInBatchesWithContext adds documents from a CSV reader to the index in batches of specified size using the provided context for cancellation. AddDocumentsCsvFromReaderInBatchesWithContext(ctx context.Context, documents io.Reader, batchSize int, options *CsvDocumentsQuery) ([]TaskInfo, error) // AddDocumentsCsvFromReader adds documents from a CSV reader to the index. AddDocumentsCsvFromReader(documents io.Reader, options *CsvDocumentsQuery) (*TaskInfo, error) // AddDocumentsCsvFromReaderWithContext adds documents from a CSV reader to the index using the provided context for cancellation. AddDocumentsCsvFromReaderWithContext(ctx context.Context, documents io.Reader, options *CsvDocumentsQuery) (*TaskInfo, error) // AddDocumentsNdjson adds documents from a NDJSON byte array to the index. AddDocumentsNdjson(documents []byte, primaryKey ...string) (*TaskInfo, error) // AddDocumentsNdjsonWithContext adds documents from a NDJSON byte array to the index using the provided context for cancellation. AddDocumentsNdjsonWithContext(ctx context.Context, documents []byte, primaryKey ...string) (*TaskInfo, error) // AddDocumentsNdjsonInBatches adds documents from a NDJSON byte array to the index in batches of specified size. AddDocumentsNdjsonInBatches(documents []byte, batchSize int, primaryKey ...string) ([]TaskInfo, error) // AddDocumentsNdjsonInBatchesWithContext adds documents from a NDJSON byte array to the index in batches of specified size using the provided context for cancellation. AddDocumentsNdjsonInBatchesWithContext(ctx context.Context, documents []byte, batchSize int, primaryKey ...string) ([]TaskInfo, error) // AddDocumentsNdjsonFromReader adds documents from a NDJSON reader to the index. AddDocumentsNdjsonFromReader(documents io.Reader, primaryKey ...string) (*TaskInfo, error) // AddDocumentsNdjsonFromReaderWithContext adds documents from a NDJSON reader to the index using the provided context for cancellation. AddDocumentsNdjsonFromReaderWithContext(ctx context.Context, documents io.Reader, primaryKey ...string) (*TaskInfo, error) // AddDocumentsNdjsonFromReaderInBatches adds documents from a NDJSON reader to the index in batches of specified size. AddDocumentsNdjsonFromReaderInBatches(documents io.Reader, batchSize int, primaryKey ...string) ([]TaskInfo, error) // AddDocumentsNdjsonFromReaderInBatchesWithContext adds documents from a NDJSON reader to the index in batches of specified size using the provided context for cancellation. AddDocumentsNdjsonFromReaderInBatchesWithContext(ctx context.Context, documents io.Reader, batchSize int, primaryKey ...string) ([]TaskInfo, error) // UpdateDocuments updates multiple documents in the index. UpdateDocuments(documentsPtr interface{}, primaryKey ...string) (*TaskInfo, error) // UpdateDocumentsWithContext updates multiple documents in the index using the provided context for cancellation. UpdateDocumentsWithContext(ctx context.Context, documentsPtr interface{}, primaryKey ...string) (*TaskInfo, error) // UpdateDocumentsInBatches updates documents in the index in batches of specified size. UpdateDocumentsInBatches(documentsPtr interface{}, batchSize int, primaryKey ...string) ([]TaskInfo, error) // UpdateDocumentsInBatchesWithContext updates documents in the index in batches of specified size using the provided context for cancellation. UpdateDocumentsInBatchesWithContext(ctx context.Context, documentsPtr interface{}, batchSize int, primaryKey ...string) ([]TaskInfo, error) // UpdateDocumentsCsv updates documents in the index from a CSV byte array. UpdateDocumentsCsv(documents []byte, options *CsvDocumentsQuery) (*TaskInfo, error) // UpdateDocumentsCsvWithContext updates documents in the index from a CSV byte array using the provided context for cancellation. UpdateDocumentsCsvWithContext(ctx context.Context, documents []byte, options *CsvDocumentsQuery) (*TaskInfo, error) // UpdateDocumentsCsvInBatches updates documents in the index from a CSV byte array in batches of specified size. UpdateDocumentsCsvInBatches(documents []byte, batchsize int, options *CsvDocumentsQuery) ([]TaskInfo, error) // UpdateDocumentsCsvInBatchesWithContext updates documents in the index from a CSV byte array in batches of specified size using the provided context for cancellation. UpdateDocumentsCsvInBatchesWithContext(ctx context.Context, documents []byte, batchsize int, options *CsvDocumentsQuery) ([]TaskInfo, error) // UpdateDocumentsNdjson updates documents in the index from a NDJSON byte array. UpdateDocumentsNdjson(documents []byte, primaryKey ...string) (*TaskInfo, error) // UpdateDocumentsNdjsonWithContext updates documents in the index from a NDJSON byte array using the provided context for cancellation. UpdateDocumentsNdjsonWithContext(ctx context.Context, documents []byte, primaryKey ...string) (*TaskInfo, error) // UpdateDocumentsNdjsonInBatches updates documents in the index from a NDJSON byte array in batches of specified size. UpdateDocumentsNdjsonInBatches(documents []byte, batchsize int, primaryKey ...string) ([]TaskInfo, error) // UpdateDocumentsNdjsonInBatchesWithContext updates documents in the index from a NDJSON byte array in batches of specified size using the provided context for cancellation. UpdateDocumentsNdjsonInBatchesWithContext(ctx context.Context, documents []byte, batchsize int, primaryKey ...string) ([]TaskInfo, error) // UpdateDocumentsByFunction update documents by using function UpdateDocumentsByFunction(req *UpdateDocumentByFunctionRequest) (*TaskInfo, error) // UpdateDocumentsByFunctionWithContext update documents by using function then provided context for cancellation. UpdateDocumentsByFunctionWithContext(ctx context.Context, req *UpdateDocumentByFunctionRequest) (*TaskInfo, error) // DeleteDocument deletes a single document from the index by identifier. DeleteDocument(identifier string) (*TaskInfo, error) // DeleteDocumentWithContext deletes a single document from the index by identifier using the provided context for cancellation. DeleteDocumentWithContext(ctx context.Context, identifier string) (*TaskInfo, error) // DeleteDocuments deletes multiple documents from the index by identifiers. DeleteDocuments(identifiers []string) (*TaskInfo, error) // DeleteDocumentsWithContext deletes multiple documents from the index by identifiers using the provided context for cancellation. DeleteDocumentsWithContext(ctx context.Context, identifiers []string) (*TaskInfo, error) // DeleteDocumentsByFilter deletes documents from the index by filter. DeleteDocumentsByFilter(filter interface{}) (*TaskInfo, error) // DeleteDocumentsByFilterWithContext deletes documents from the index by filter using the provided context for cancellation. DeleteDocumentsByFilterWithContext(ctx context.Context, filter interface{}) (*TaskInfo, error) // DeleteAllDocuments deletes all documents from the index. DeleteAllDocuments() (*TaskInfo, error) // DeleteAllDocumentsWithContext deletes all documents from the index using the provided context for cancellation. DeleteAllDocumentsWithContext(ctx context.Context) (*TaskInfo, error) }
type DocumentQuery ΒΆ
type DocumentQuery struct {
Fields []string `json:"fields,omitempty"`
}
DocumentQuery is the request body get one documents method
func (DocumentQuery) MarshalEasyJSON ΒΆ
func (v DocumentQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DocumentQuery) MarshalJSON ΒΆ
func (v DocumentQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DocumentQuery) UnmarshalEasyJSON ΒΆ
func (v *DocumentQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DocumentQuery) UnmarshalJSON ΒΆ
func (v *DocumentQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DocumentReader ΒΆ
type DocumentReader interface { // GetDocument retrieves a single document from the index by identifier. GetDocument(identifier string, request *DocumentQuery, documentPtr interface{}) error // GetDocumentWithContext retrieves a single document from the index by identifier using the provided context for cancellation. GetDocumentWithContext(ctx context.Context, identifier string, request *DocumentQuery, documentPtr interface{}) error // GetDocuments retrieves multiple documents from the index. GetDocuments(param *DocumentsQuery, resp *DocumentsResult) error // GetDocumentsWithContext retrieves multiple documents from the index using the provided context for cancellation. GetDocumentsWithContext(ctx context.Context, param *DocumentsQuery, resp *DocumentsResult) error }
type DocumentsQuery ΒΆ
type DocumentsQuery struct { Offset int64 `json:"offset,omitempty"` Limit int64 `json:"limit,omitempty"` Fields []string `json:"fields,omitempty"` Filter interface{} `json:"filter,omitempty"` }
DocumentsQuery is the request body for list documents method
func (DocumentsQuery) MarshalEasyJSON ΒΆ
func (v DocumentsQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DocumentsQuery) MarshalJSON ΒΆ
func (v DocumentsQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DocumentsQuery) UnmarshalEasyJSON ΒΆ
func (v *DocumentsQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DocumentsQuery) UnmarshalJSON ΒΆ
func (v *DocumentsQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DocumentsResult ΒΆ
type DocumentsResult struct { Results []map[string]interface{} `json:"results"` Limit int64 `json:"limit"` Offset int64 `json:"offset"` Total int64 `json:"total"` }
func (DocumentsResult) MarshalEasyJSON ΒΆ
func (v DocumentsResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DocumentsResult) MarshalJSON ΒΆ
func (v DocumentsResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DocumentsResult) UnmarshalEasyJSON ΒΆ
func (v *DocumentsResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DocumentsResult) UnmarshalJSON ΒΆ
func (v *DocumentsResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Embedder ΒΆ
type Embedder struct { Source string `json:"source"` // The type of embedder: "openAi", "huggingFace", "userProvided", "rest", "ollama" Model string `json:"model,omitempty"` // Optional for "openAi", "huggingFace", "ollama" APIKey string `json:"apiKey,omitempty"` // Optional for "openAi", "rest", "ollama" DocumentTemplate string `json:"documentTemplate,omitempty"` // Optional for most embedders Dimensions int `json:"dimensions,omitempty"` // Optional for "openAi", "rest", "userProvided", "ollama" Distribution *Distribution `json:"distribution,omitempty"` // Optional for all embedders URL string `json:"url,omitempty"` // Optional for "openAi", "rest", "ollama" Revision string `json:"revision,omitempty"` // Optional for "huggingFace" Request map[string]interface{} `json:"request,omitempty"` // Optional for "rest" Response map[string]interface{} `json:"response,omitempty"` // Optional for "rest" Headers map[string]string `json:"headers,omitempty"` // Optional for "rest" }
Embedder represents a unified configuration for various embedder types.
func (Embedder) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Embedder) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Embedder) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Embedder) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type EncodingCompressionLevel ΒΆ
type EncodingCompressionLevel int
func (EncodingCompressionLevel) Int ΒΆ
func (c EncodingCompressionLevel) Int() int
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 // ErrCodeResponseUnmarshalBody impossible deserialize the response body ErrCodeResponseUnmarshalBody // MeilisearchApiError send by the meilisearch api MeilisearchApiError // MeilisearchApiErrorWithoutMessage MeilisearchApiError send by the meilisearch api MeilisearchApiErrorWithoutMessage // MeilisearchTimeoutError MeilisearchTimeoutError // MeilisearchCommunicationError impossible execute a request MeilisearchCommunicationError // MeilisearchMaxRetriesExceeded used max retries and exceeded MeilisearchMaxRetriesExceeded )
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 // 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 // Error info from meilisearch api // Message is the raw request into string ('empty meilisearch message' if not present) MeilisearchApiError meilisearchApiError // 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)
type ExperimentalFeatures ΒΆ
type ExperimentalFeatures struct { ExperimentalFeaturesBase // contains filtered or unexported fields }
Type for experimental features with additional client field
func (*ExperimentalFeatures) Get ΒΆ
func (ef *ExperimentalFeatures) Get() (*ExperimentalFeaturesResult, error)
func (*ExperimentalFeatures) GetWithContext ΒΆ
func (ef *ExperimentalFeatures) GetWithContext(ctx context.Context) (*ExperimentalFeaturesResult, error)
func (*ExperimentalFeatures) SetContainsFilter ΒΆ
func (ef *ExperimentalFeatures) SetContainsFilter(containsFilter bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetEditDocumentsByFunction ΒΆ
func (ef *ExperimentalFeatures) SetEditDocumentsByFunction(editDocumentsByFunction bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetLogsRoute ΒΆ
func (ef *ExperimentalFeatures) SetLogsRoute(logsRoute bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetMetrics ΒΆ
func (ef *ExperimentalFeatures) SetMetrics(metrics bool) *ExperimentalFeatures
func (*ExperimentalFeatures) Update ΒΆ
func (ef *ExperimentalFeatures) Update() (*ExperimentalFeaturesResult, error)
func (*ExperimentalFeatures) UpdateWithContext ΒΆ
func (ef *ExperimentalFeatures) UpdateWithContext(ctx context.Context) (*ExperimentalFeaturesResult, error)
type ExperimentalFeaturesBase ΒΆ
type ExperimentalFeaturesBase struct { LogsRoute *bool `json:"logsRoute,omitempty"` Metrics *bool `json:"metrics,omitempty"` EditDocumentsByFunction *bool `json:"editDocumentsByFunction,omitempty"` ContainsFilter *bool `json:"containsFilter,omitempty"` }
ExperimentalFeaturesResult represents the experimental features result from the API.
func (ExperimentalFeaturesBase) MarshalEasyJSON ΒΆ
func (v ExperimentalFeaturesBase) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ExperimentalFeaturesBase) MarshalJSON ΒΆ
func (v ExperimentalFeaturesBase) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ExperimentalFeaturesBase) UnmarshalEasyJSON ΒΆ
func (v *ExperimentalFeaturesBase) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ExperimentalFeaturesBase) UnmarshalJSON ΒΆ
func (v *ExperimentalFeaturesBase) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ExperimentalFeaturesResult ΒΆ
type ExperimentalFeaturesResult struct { LogsRoute bool `json:"logsRoute"` Metrics bool `json:"metrics"` EditDocumentsByFunction bool `json:"editDocumentsByFunction"` ContainsFilter bool `json:"containsFilter"` }
func (ExperimentalFeaturesResult) MarshalEasyJSON ΒΆ
func (v ExperimentalFeaturesResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ExperimentalFeaturesResult) MarshalJSON ΒΆ
func (v ExperimentalFeaturesResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ExperimentalFeaturesResult) UnmarshalEasyJSON ΒΆ
func (v *ExperimentalFeaturesResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ExperimentalFeaturesResult) UnmarshalJSON ΒΆ
func (v *ExperimentalFeaturesResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FacetSearchRequest ΒΆ
type FacetSearchRequest struct { FacetName string `json:"facetName,omitempty"` FacetQuery string `json:"facetQuery,omitempty"` Q string `json:"q,omitempty"` Filter string `json:"filter,omitempty"` MatchingStrategy string `json:"matchingStrategy,omitempty"` AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"` }
func (FacetSearchRequest) MarshalEasyJSON ΒΆ
func (v FacetSearchRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FacetSearchRequest) MarshalJSON ΒΆ
func (v FacetSearchRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FacetSearchRequest) UnmarshalEasyJSON ΒΆ
func (v *FacetSearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FacetSearchRequest) UnmarshalJSON ΒΆ
func (v *FacetSearchRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FacetSearchResponse ΒΆ
type FacetSearchResponse struct { FacetHits []interface{} `json:"facetHits"` FacetQuery string `json:"facetQuery"` ProcessingTimeMs int64 `json:"processingTimeMs"` }
func (FacetSearchResponse) MarshalEasyJSON ΒΆ
func (v FacetSearchResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FacetSearchResponse) MarshalJSON ΒΆ
func (v FacetSearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FacetSearchResponse) UnmarshalEasyJSON ΒΆ
func (v *FacetSearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FacetSearchResponse) UnmarshalJSON ΒΆ
func (v *FacetSearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Faceting ΒΆ
type Faceting struct { MaxValuesPerFacet int64 `json:"maxValuesPerFacet"` // SortFacetValuesBy index_name: alpha|count SortFacetValuesBy map[string]SortFacetType `json:"sortFacetValuesBy"` }
Faceting is the type that represents the faceting setting in meilisearch
func (Faceting) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Faceting) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Faceting) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Faceting) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type Health ΒΆ
type Health struct {
Status string `json:"status"`
}
Health is the request body for set meilisearch health
func (Health) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Health) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Health) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Health) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type IndexConfig ΒΆ
type IndexConfig struct { // Uid is the unique identifier of a given index. Uid string // PrimaryKey is optional PrimaryKey string }
func (IndexConfig) MarshalEasyJSON ΒΆ
func (v IndexConfig) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexConfig) MarshalJSON ΒΆ
func (v IndexConfig) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexConfig) UnmarshalEasyJSON ΒΆ
func (v *IndexConfig) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexConfig) UnmarshalJSON ΒΆ
func (v *IndexConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type IndexManager ΒΆ
type IndexManager interface { IndexReader TaskReader DocumentManager SettingsManager SearchReader GetIndexReader() IndexReader GetTaskReader() TaskReader GetDocumentManager() DocumentManager GetDocumentReader() DocumentReader GetSettingsManager() SettingsManager GetSettingsReader() SettingsReader GetSearch() SearchReader // UpdateIndex updates the primary key of the index. UpdateIndex(primaryKey string) (*TaskInfo, error) // UpdateIndexWithContext updates the primary key of the index using the provided context for cancellation. UpdateIndexWithContext(ctx context.Context, primaryKey string) (*TaskInfo, error) // Delete removes the index identified by the given UID. Delete(uid string) (bool, error) // DeleteWithContext removes the index identified by the given UID using the provided context for cancellation. DeleteWithContext(ctx context.Context, uid string) (bool, error) }
type IndexReader ΒΆ
type IndexReader interface { // FetchInfo retrieves information about the index. FetchInfo() (*IndexResult, error) // FetchInfoWithContext retrieves information about the index using the provided context for cancellation. FetchInfoWithContext(ctx context.Context) (*IndexResult, error) // FetchPrimaryKey retrieves the primary key of the index. FetchPrimaryKey() (*string, error) // FetchPrimaryKeyWithContext retrieves the primary key of the index using the provided context for cancellation. FetchPrimaryKeyWithContext(ctx context.Context) (*string, error) // GetStats retrieves statistical information about the index. GetStats() (*StatsIndex, error) // GetStatsWithContext retrieves statistical information about the index using the provided context for cancellation. GetStatsWithContext(ctx context.Context) (*StatsIndex, error) }
type IndexResult ΒΆ
type IndexResult struct { UID string `json:"uid"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` PrimaryKey string `json:"primaryKey,omitempty"` IndexManager }
func (IndexResult) MarshalEasyJSON ΒΆ
func (v IndexResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexResult) MarshalJSON ΒΆ
func (v IndexResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexResult) UnmarshalEasyJSON ΒΆ
func (v *IndexResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexResult) UnmarshalJSON ΒΆ
func (v *IndexResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type IndexesQuery ΒΆ
func (IndexesQuery) MarshalEasyJSON ΒΆ
func (v IndexesQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexesQuery) MarshalJSON ΒΆ
func (v IndexesQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexesQuery) UnmarshalEasyJSON ΒΆ
func (v *IndexesQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexesQuery) UnmarshalJSON ΒΆ
func (v *IndexesQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type IndexesResults ΒΆ
type IndexesResults struct { Results []*IndexResult `json:"results"` Offset int64 `json:"offset"` Limit int64 `json:"limit"` Total int64 `json:"total"` }
IndexesResults return of multiple indexes is wrap in a IndexesResults
func (IndexesResults) MarshalEasyJSON ΒΆ
func (v IndexesResults) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexesResults) MarshalJSON ΒΆ
func (v IndexesResults) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexesResults) UnmarshalEasyJSON ΒΆ
func (v *IndexesResults) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexesResults) UnmarshalJSON ΒΆ
func (v *IndexesResults) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Key ΒΆ
type Key struct { Name string `json:"name"` Description string `json:"description"` Key string `json:"key,omitempty"` UID string `json:"uid,omitempty"` Actions []string `json:"actions,omitempty"` Indexes []string `json:"indexes,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` ExpiresAt time.Time `json:"expiresAt"` }
Key allow the user to connect to the meilisearch instance
Documentation: https://www.meilisearch.com/docs/learn/security/master_api_keys#protecting-a-meilisearch-instance
func (Key) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Key) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Key) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Key) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type KeyManager ΒΆ
type KeyManager interface { KeyReader // CreateKey creates a new API key. CreateKey(request *Key) (*Key, error) // CreateKeyWithContext creates a new API key with a context for cancellation. CreateKeyWithContext(ctx context.Context, request *Key) (*Key, error) // UpdateKey updates a specific API key. UpdateKey(keyOrUID string, request *Key) (*Key, error) // UpdateKeyWithContext updates a specific API key with a context for cancellation. UpdateKeyWithContext(ctx context.Context, keyOrUID string, request *Key) (*Key, error) // DeleteKey deletes a specific API key. DeleteKey(keyOrUID string) (bool, error) // DeleteKeyWithContext deletes a specific API key with a context for cancellation. DeleteKeyWithContext(ctx context.Context, keyOrUID string) (bool, error) }
type KeyParsed ΒΆ
type KeyParsed struct { Name string `json:"name"` Description string `json:"description"` UID string `json:"uid,omitempty"` Actions []string `json:"actions,omitempty"` Indexes []string `json:"indexes,omitempty"` ExpiresAt *string `json:"expiresAt"` }
KeyParsed this structure is used to send the exact ISO-8601 time format managed by meilisearch
func (KeyParsed) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeyParsed) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*KeyParsed) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeyParsed) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type KeyReader ΒΆ
type KeyReader interface { // GetKey fetches the details of a specific API key. GetKey(identifier string) (*Key, error) // GetKeyWithContext fetches the details of a specific API key with a context for cancellation. GetKeyWithContext(ctx context.Context, identifier string) (*Key, error) // GetKeys lists all API keys. GetKeys(param *KeysQuery) (*KeysResults, error) // GetKeysWithContext lists all API keys with a context for cancellation. GetKeysWithContext(ctx context.Context, param *KeysQuery) (*KeysResults, error) }
type KeyUpdate ΒΆ
type KeyUpdate struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` }
KeyUpdate this structure is used to update a Key
func (KeyUpdate) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeyUpdate) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*KeyUpdate) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeyUpdate) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type KeysQuery ΒΆ
func (KeysQuery) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeysQuery) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*KeysQuery) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeysQuery) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type KeysResults ΒΆ
type KeysResults struct { Results []Key `json:"results"` Offset int64 `json:"offset"` Limit int64 `json:"limit"` Total int64 `json:"total"` }
KeysResults return of multiple keys is wrap in a KeysResults
func (KeysResults) MarshalEasyJSON ΒΆ
func (v KeysResults) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeysResults) MarshalJSON ΒΆ
func (v KeysResults) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*KeysResults) UnmarshalEasyJSON ΒΆ
func (v *KeysResults) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeysResults) UnmarshalJSON ΒΆ
func (v *KeysResults) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LocalizedAttributes ΒΆ
type LocalizedAttributes struct { Locales []string `json:"locales,omitempty"` AttributePatterns []string `json:"attributePatterns,omitempty"` }
func (LocalizedAttributes) MarshalEasyJSON ΒΆ
func (v LocalizedAttributes) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LocalizedAttributes) MarshalJSON ΒΆ
func (v LocalizedAttributes) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LocalizedAttributes) UnmarshalEasyJSON ΒΆ
func (v *LocalizedAttributes) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LocalizedAttributes) UnmarshalJSON ΒΆ
func (v *LocalizedAttributes) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MatchingStrategy ΒΆ
type MatchingStrategy string // MatchingStrategy one of the Last, All, Frequency
const ( // Last returns documents containing all the query terms first. If there are not enough results containing all // query terms to meet the requested limit, Meilisearch will remove one query term at a time, // starting from the end of the query. Last MatchingStrategy = "last" // All only returns documents that contain all query terms. Meilisearch will not match any more documents even // if there aren't enough to meet the requested limit. All MatchingStrategy = "all" // Frequency returns documents containing all the query terms first. If there are not enough results containing //all query terms to meet the requested limit, Meilisearch will remove one query term at a time, starting //with the word that is the most frequent in the dataset. frequency effectively gives more weight to terms //that appear less frequently in a set of results. Frequency MatchingStrategy = "frequency" )
type MinWordSizeForTypos ΒΆ
type MinWordSizeForTypos struct { OneTypo int64 `json:"oneTypo,omitempty"` TwoTypos int64 `json:"twoTypos,omitempty"` }
MinWordSizeForTypos is the type that represents the minWordSizeForTypos setting in the typo tolerance setting in meilisearch
func (MinWordSizeForTypos) MarshalEasyJSON ΒΆ
func (v MinWordSizeForTypos) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MinWordSizeForTypos) MarshalJSON ΒΆ
func (v MinWordSizeForTypos) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MinWordSizeForTypos) UnmarshalEasyJSON ΒΆ
func (v *MinWordSizeForTypos) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MinWordSizeForTypos) UnmarshalJSON ΒΆ
func (v *MinWordSizeForTypos) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSearchFederation ΒΆ
type MultiSearchFederation struct { Offset int64 `json:"offset,omitempty"` Limit int64 `json:"limit,omitempty"` }
func (MultiSearchFederation) MarshalEasyJSON ΒΆ
func (v MultiSearchFederation) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSearchFederation) MarshalJSON ΒΆ
func (v MultiSearchFederation) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSearchFederation) UnmarshalEasyJSON ΒΆ
func (v *MultiSearchFederation) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSearchFederation) UnmarshalJSON ΒΆ
func (v *MultiSearchFederation) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSearchRequest ΒΆ
type MultiSearchRequest struct { Federation *MultiSearchFederation `json:"federation,omitempty"` Queries []*SearchRequest `json:"queries"` }
func (MultiSearchRequest) MarshalEasyJSON ΒΆ
func (v MultiSearchRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSearchRequest) MarshalJSON ΒΆ
func (v MultiSearchRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSearchRequest) UnmarshalEasyJSON ΒΆ
func (v *MultiSearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSearchRequest) UnmarshalJSON ΒΆ
func (v *MultiSearchRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSearchResponse ΒΆ
type MultiSearchResponse struct { Results []SearchResponse `json:"results,omitempty"` Hits []interface{} `json:"hits,omitempty"` ProcessingTimeMs int64 `json:"processingTimeMs,omitempty"` Offset int64 `json:"offset,omitempty"` Limit int64 `json:"limit,omitempty"` EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"` SemanticHitCount int64 `json:"semanticHitCount,omitempty"` }
func (MultiSearchResponse) MarshalEasyJSON ΒΆ
func (v MultiSearchResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSearchResponse) MarshalJSON ΒΆ
func (v MultiSearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSearchResponse) UnmarshalEasyJSON ΒΆ
func (v *MultiSearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSearchResponse) UnmarshalJSON ΒΆ
func (v *MultiSearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Option ΒΆ
type Option func(*meiliOpt)
func WithAPIKey ΒΆ
WithAPIKey is API key or master key.
func WithContentEncoding ΒΆ
func WithContentEncoding(encodingType ContentEncoding, level EncodingCompressionLevel) Option
WithContentEncoding support the Content-Encoding header indicates the media type is compressed by a given algorithm. compression improves transfer speed and reduces bandwidth consumption by sending and receiving smaller payloads. the Accept-Encoding header, instead, indicates the compression algorithm the client understands.
more: https://www.meilisearch.com/docs/reference/api/overview#content-encoding
func WithCustomClient ΒΆ
WithCustomClient set custom http.Client
func WithCustomClientWithTLS ΒΆ
WithCustomClientWithTLS client support tls configuration
func WithCustomRetries ΒΆ
WithCustomRetries set retry on specific http error code and max retries (min: 1, max: 255)
type Pagination ΒΆ
type Pagination struct {
MaxTotalHits int64 `json:"maxTotalHits"`
}
Pagination is the type that represents the pagination setting in meilisearch
func (Pagination) MarshalEasyJSON ΒΆ
func (v Pagination) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Pagination) MarshalJSON ΒΆ
func (v Pagination) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Pagination) UnmarshalEasyJSON ΒΆ
func (v *Pagination) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Pagination) UnmarshalJSON ΒΆ
func (v *Pagination) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ProximityPrecisionType ΒΆ
type ProximityPrecisionType string // ProximityPrecisionType accepts one of the ByWord or ByAttribute
const ( // ByWord calculate the precise distance between query terms. Higher precision, but may lead to longer // indexing time. This is the default setting ByWord ProximityPrecisionType = "byWord" // ByAttribute determine if multiple query terms are present in the same attribute. // Lower precision, but shorter indexing time ByAttribute ProximityPrecisionType = "byAttribute" )
type RawType ΒΆ
type RawType []byte
RawType is an alias for raw byte[]
func (RawType) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*RawType) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type SearchFederationOptions ΒΆ
type SearchFederationOptions struct {
Weight float64 `json:"weight"`
}
func (SearchFederationOptions) MarshalEasyJSON ΒΆ
func (v SearchFederationOptions) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchFederationOptions) MarshalJSON ΒΆ
func (v SearchFederationOptions) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchFederationOptions) UnmarshalEasyJSON ΒΆ
func (v *SearchFederationOptions) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchFederationOptions) UnmarshalJSON ΒΆ
func (v *SearchFederationOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SearchReader ΒΆ
type SearchReader interface { // Search performs a search query on the index. Search(query string, request *SearchRequest) (*SearchResponse, error) // SearchWithContext performs a search query on the index using the provided context for cancellation. SearchWithContext(ctx context.Context, query string, request *SearchRequest) (*SearchResponse, error) // SearchRaw performs a raw search query on the index, returning a JSON response. SearchRaw(query string, request *SearchRequest) (*json.RawMessage, error) // SearchRawWithContext performs a raw search query on the index using the provided context for cancellation, returning a JSON response. SearchRawWithContext(ctx context.Context, query string, request *SearchRequest) (*json.RawMessage, error) // FacetSearch performs a facet search query on the index. FacetSearch(request *FacetSearchRequest) (*json.RawMessage, error) // FacetSearchWithContext performs a facet search query on the index using the provided context for cancellation. FacetSearchWithContext(ctx context.Context, request *FacetSearchRequest) (*json.RawMessage, error) // SearchSimilarDocuments performs a search for similar documents. SearchSimilarDocuments(param *SimilarDocumentQuery, resp *SimilarDocumentResult) error // SearchSimilarDocumentsWithContext performs a search for similar documents using the provided context for cancellation. SearchSimilarDocumentsWithContext(ctx context.Context, param *SimilarDocumentQuery, resp *SimilarDocumentResult) error }
type SearchRequest ΒΆ
type SearchRequest struct { Offset int64 `json:"offset,omitempty"` Limit int64 `json:"limit,omitempty"` AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"` AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"` AttributesToCrop []string `json:"attributesToCrop,omitempty"` CropLength int64 `json:"cropLength,omitempty"` CropMarker string `json:"cropMarker,omitempty"` AttributesToHighlight []string `json:"attributesToHighlight,omitempty"` HighlightPreTag string `json:"highlightPreTag,omitempty"` HighlightPostTag string `json:"highlightPostTag,omitempty"` MatchingStrategy MatchingStrategy `json:"matchingStrategy,omitempty"` Filter interface{} `json:"filter,omitempty"` ShowMatchesPosition bool `json:"showMatchesPosition,omitempty"` ShowRankingScore bool `json:"showRankingScore,omitempty"` ShowRankingScoreDetails bool `json:"showRankingScoreDetails,omitempty"` Facets []string `json:"facets,omitempty"` Sort []string `json:"sort,omitempty"` Vector []float32 `json:"vector,omitempty"` HitsPerPage int64 `json:"hitsPerPage,omitempty"` Page int64 `json:"page,omitempty"` IndexUID string `json:"indexUid,omitempty"` Query string `json:"q"` Distinct string `json:"distinct,omitempty"` Hybrid *SearchRequestHybrid `json:"hybrid"` RetrieveVectors bool `json:"retrieveVectors,omitempty"` RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"` FederationOptions *SearchFederationOptions `json:"federationOptions,omitempty"` Locates []string `json:"locales,omitempty"` }
SearchRequest is the request url param needed for a search query. This struct will be converted to url param before sent.
Documentation: https://www.meilisearch.com/docs/reference/api/search#search-parameters
func (SearchRequest) MarshalEasyJSON ΒΆ
func (v SearchRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchRequest) MarshalJSON ΒΆ
func (v SearchRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchRequest) UnmarshalEasyJSON ΒΆ
func (v *SearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchRequest) UnmarshalJSON ΒΆ
func (v *SearchRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SearchRequestHybrid ΒΆ
type SearchRequestHybrid struct { SemanticRatio float64 `json:"semanticRatio,omitempty"` Embedder string `json:"embedder"` }
func (SearchRequestHybrid) MarshalEasyJSON ΒΆ
func (v SearchRequestHybrid) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchRequestHybrid) MarshalJSON ΒΆ
func (v SearchRequestHybrid) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchRequestHybrid) UnmarshalEasyJSON ΒΆ
func (v *SearchRequestHybrid) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchRequestHybrid) UnmarshalJSON ΒΆ
func (v *SearchRequestHybrid) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SearchResponse ΒΆ
type SearchResponse struct { Hits []interface{} `json:"hits"` EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"` Offset int64 `json:"offset,omitempty"` Limit int64 `json:"limit,omitempty"` ProcessingTimeMs int64 `json:"processingTimeMs"` Query string `json:"query"` FacetDistribution interface{} `json:"facetDistribution,omitempty"` TotalHits int64 `json:"totalHits,omitempty"` HitsPerPage int64 `json:"hitsPerPage,omitempty"` Page int64 `json:"page,omitempty"` TotalPages int64 `json:"totalPages,omitempty"` FacetStats interface{} `json:"facetStats,omitempty"` IndexUID string `json:"indexUid,omitempty"` }
SearchResponse is the response body for search method
func (SearchResponse) MarshalEasyJSON ΒΆ
func (v SearchResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchResponse) MarshalJSON ΒΆ
func (v SearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchResponse) UnmarshalEasyJSON ΒΆ
func (v *SearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchResponse) UnmarshalJSON ΒΆ
func (v *SearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ServiceManager ΒΆ
type ServiceManager interface { ServiceReader KeyManager TaskManager ServiceReader() ServiceReader TaskManager() TaskManager TaskReader() TaskReader KeyManager() KeyManager KeyReader() KeyReader // CreateIndex creates a new index. CreateIndex(config *IndexConfig) (*TaskInfo, error) // CreateIndexWithContext creates a new index with a context for cancellation. CreateIndexWithContext(ctx context.Context, config *IndexConfig) (*TaskInfo, error) // DeleteIndex deletes a specific index. DeleteIndex(uid string) (*TaskInfo, error) // DeleteIndexWithContext deletes a specific index with a context for cancellation. DeleteIndexWithContext(ctx context.Context, uid string) (*TaskInfo, error) // SwapIndexes swaps the positions of two indexes. SwapIndexes(param []*SwapIndexesParams) (*TaskInfo, error) // SwapIndexesWithContext swaps the positions of two indexes with a context for cancellation. SwapIndexesWithContext(ctx context.Context, param []*SwapIndexesParams) (*TaskInfo, error) // GenerateTenantToken generates a tenant token for multi-tenancy. GenerateTenantToken(apiKeyUID string, searchRules map[string]interface{}, options *TenantTokenOptions) (string, error) // CreateDump creates a database dump. CreateDump() (*TaskInfo, error) // CreateDumpWithContext creates a database dump with a context for cancellation. CreateDumpWithContext(ctx context.Context) (*TaskInfo, error) // CreateSnapshot create database snapshot from meilisearch CreateSnapshot() (*TaskInfo, error) // CreateSnapshotWithContext create database snapshot from meilisearch and support parent context CreateSnapshotWithContext(ctx context.Context) (*TaskInfo, error) // ExperimentalFeatures returns the experimental features manager. ExperimentalFeatures() *ExperimentalFeatures // Close closes the connection to the Meilisearch server. Close() }
func Connect ΒΆ
func Connect(host string, options ...Option) (ServiceManager, error)
Connect create service manager and check connection with meilisearch
Example ΒΆ
meili, err := Connect("http://localhost:7700", WithAPIKey("foobar")) if err != nil { fmt.Println(err) return } ver, err := meili.Version() if err != nil { fmt.Println(err) return } fmt.Println(ver.PkgVersion)
Output:
func New ΒΆ
func New(host string, options ...Option) ServiceManager
New create new service manager for operating on meilisearch
Example ΒΆ
// WithAPIKey is optional meili := New("http://localhost:7700", WithAPIKey("foobar")) // An index is where the documents are stored. idx := meili.Index("movies") // If the index 'movies' does not exist, Meilisearch creates it when you first add the documents. documents := []map[string]interface{}{ {"id": 1, "title": "Carol", "genres": []string{"Romance", "Drama"}}, {"id": 2, "title": "Wonder Woman", "genres": []string{"Action", "Adventure"}}, {"id": 3, "title": "Life of Pi", "genres": []string{"Adventure", "Drama"}}, {"id": 4, "title": "Mad Max: Fury Road", "genres": []string{"Adventure", "Science Fiction"}}, {"id": 5, "title": "Moana", "genres": []string{"Fantasy", "Action"}}, {"id": 6, "title": "Philadelphia", "genres": []string{"Drama"}}, } task, err := idx.AddDocuments(documents) if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(task.TaskUID)
Output:
type ServiceReader ΒΆ
type ServiceReader interface { // Index retrieves an IndexManager for a specific index. Index(uid string) IndexManager // GetIndex fetches the details of a specific index. GetIndex(indexID string) (*IndexResult, error) // GetIndexWithContext fetches the details of a specific index with a context for cancellation. GetIndexWithContext(ctx context.Context, indexID string) (*IndexResult, error) // GetRawIndex fetches the raw JSON representation of a specific index. GetRawIndex(uid string) (map[string]interface{}, error) // GetRawIndexWithContext fetches the raw JSON representation of a specific index with a context for cancellation. GetRawIndexWithContext(ctx context.Context, uid string) (map[string]interface{}, error) // ListIndexes lists all indexes. ListIndexes(param *IndexesQuery) (*IndexesResults, error) // ListIndexesWithContext lists all indexes with a context for cancellation. ListIndexesWithContext(ctx context.Context, param *IndexesQuery) (*IndexesResults, error) // GetRawIndexes fetches the raw JSON representation of all indexes. GetRawIndexes(param *IndexesQuery) (map[string]interface{}, error) // GetRawIndexesWithContext fetches the raw JSON representation of all indexes with a context for cancellation. GetRawIndexesWithContext(ctx context.Context, param *IndexesQuery) (map[string]interface{}, error) // MultiSearch performs a multi-index search. MultiSearch(queries *MultiSearchRequest) (*MultiSearchResponse, error) // MultiSearchWithContext performs a multi-index search with a context for cancellation. MultiSearchWithContext(ctx context.Context, queries *MultiSearchRequest) (*MultiSearchResponse, error) // GetStats fetches global stats. GetStats() (*Stats, error) // GetStatsWithContext fetches global stats with a context for cancellation. GetStatsWithContext(ctx context.Context) (*Stats, error) // Version fetches the version of the Meilisearch server. Version() (*Version, error) // VersionWithContext fetches the version of the Meilisearch server with a context for cancellation. VersionWithContext(ctx context.Context) (*Version, error) // Health checks the health of the Meilisearch server. Health() (*Health, error) // HealthWithContext checks the health of the Meilisearch server with a context for cancellation. HealthWithContext(ctx context.Context) (*Health, error) // IsHealthy checks if the Meilisearch server is healthy. IsHealthy() bool }
type Settings ΒΆ
type Settings struct { RankingRules []string `json:"rankingRules,omitempty"` DistinctAttribute *string `json:"distinctAttribute,omitempty"` SearchableAttributes []string `json:"searchableAttributes,omitempty"` Dictionary []string `json:"dictionary,omitempty"` SearchCutoffMs int64 `json:"searchCutoffMs,omitempty"` ProximityPrecision ProximityPrecisionType `json:"proximityPrecision,omitempty"` SeparatorTokens []string `json:"separatorTokens,omitempty"` NonSeparatorTokens []string `json:"nonSeparatorTokens,omitempty"` DisplayedAttributes []string `json:"displayedAttributes,omitempty"` StopWords []string `json:"stopWords,omitempty"` Synonyms map[string][]string `json:"synonyms,omitempty"` FilterableAttributes []string `json:"filterableAttributes,omitempty"` SortableAttributes []string `json:"sortableAttributes,omitempty"` LocalizedAttributes []*LocalizedAttributes `json:"localizedAttributes,omitempty"` TypoTolerance *TypoTolerance `json:"typoTolerance,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` Faceting *Faceting `json:"faceting,omitempty"` Embedders map[string]Embedder `json:"embedders,omitempty"` }
Settings is the type that represents the settings in meilisearch
func (Settings) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Settings) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Settings) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Settings) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type SettingsManager ΒΆ
type SettingsManager interface { SettingsReader // UpdateSettings updates the settings of the index. UpdateSettings(request *Settings) (*TaskInfo, error) // UpdateSettingsWithContext updates the settings of the index using the provided context for cancellation. UpdateSettingsWithContext(ctx context.Context, request *Settings) (*TaskInfo, error) // ResetSettings resets the settings of the index to default values. ResetSettings() (*TaskInfo, error) // ResetSettingsWithContext resets the settings of the index to default values using the provided context for cancellation. ResetSettingsWithContext(ctx context.Context) (*TaskInfo, error) // UpdateRankingRules updates the ranking rules of the index. UpdateRankingRules(request *[]string) (*TaskInfo, error) // UpdateRankingRulesWithContext updates the ranking rules of the index using the provided context for cancellation. UpdateRankingRulesWithContext(ctx context.Context, request *[]string) (*TaskInfo, error) // ResetRankingRules resets the ranking rules of the index to default values. ResetRankingRules() (*TaskInfo, error) // ResetRankingRulesWithContext resets the ranking rules of the index to default values using the provided context for cancellation. ResetRankingRulesWithContext(ctx context.Context) (*TaskInfo, error) // UpdateDistinctAttribute updates the distinct attribute of the index. UpdateDistinctAttribute(request string) (*TaskInfo, error) // UpdateDistinctAttributeWithContext updates the distinct attribute of the index using the provided context for cancellation. UpdateDistinctAttributeWithContext(ctx context.Context, request string) (*TaskInfo, error) // ResetDistinctAttribute resets the distinct attribute of the index to default value. ResetDistinctAttribute() (*TaskInfo, error) // ResetDistinctAttributeWithContext resets the distinct attribute of the index to default value using the provided context for cancellation. ResetDistinctAttributeWithContext(ctx context.Context) (*TaskInfo, error) // UpdateSearchableAttributes updates the searchable attributes of the index. UpdateSearchableAttributes(request *[]string) (*TaskInfo, error) // UpdateSearchableAttributesWithContext updates the searchable attributes of the index using the provided context for cancellation. UpdateSearchableAttributesWithContext(ctx context.Context, request *[]string) (*TaskInfo, error) // ResetSearchableAttributes resets the searchable attributes of the index to default values. ResetSearchableAttributes() (*TaskInfo, error) // ResetSearchableAttributesWithContext resets the searchable attributes of the index to default values using the provided context for cancellation. ResetSearchableAttributesWithContext(ctx context.Context) (*TaskInfo, error) // UpdateDisplayedAttributes updates the displayed attributes of the index. UpdateDisplayedAttributes(request *[]string) (*TaskInfo, error) // UpdateDisplayedAttributesWithContext updates the displayed attributes of the index using the provided context for cancellation. UpdateDisplayedAttributesWithContext(ctx context.Context, request *[]string) (*TaskInfo, error) // ResetDisplayedAttributes resets the displayed attributes of the index to default values. ResetDisplayedAttributes() (*TaskInfo, error) // ResetDisplayedAttributesWithContext resets the displayed attributes of the index to default values using the provided context for cancellation. ResetDisplayedAttributesWithContext(ctx context.Context) (*TaskInfo, error) // UpdateStopWords updates the stop words of the index. UpdateStopWords(request *[]string) (*TaskInfo, error) // UpdateStopWordsWithContext updates the stop words of the index using the provided context for cancellation. UpdateStopWordsWithContext(ctx context.Context, request *[]string) (*TaskInfo, error) // ResetStopWords resets the stop words of the index to default values. ResetStopWords() (*TaskInfo, error) // ResetStopWordsWithContext resets the stop words of the index to default values using the provided context for cancellation. ResetStopWordsWithContext(ctx context.Context) (*TaskInfo, error) // UpdateSynonyms updates the synonyms of the index. UpdateSynonyms(request *map[string][]string) (*TaskInfo, error) // UpdateSynonymsWithContext updates the synonyms of the index using the provided context for cancellation. UpdateSynonymsWithContext(ctx context.Context, request *map[string][]string) (*TaskInfo, error) // ResetSynonyms resets the synonyms of the index to default values. ResetSynonyms() (*TaskInfo, error) // ResetSynonymsWithContext resets the synonyms of the index to default values using the provided context for cancellation. ResetSynonymsWithContext(ctx context.Context) (*TaskInfo, error) // UpdateFilterableAttributes updates the filterable attributes of the index. UpdateFilterableAttributes(request *[]string) (*TaskInfo, error) // UpdateFilterableAttributesWithContext updates the filterable attributes of the index using the provided context for cancellation. UpdateFilterableAttributesWithContext(ctx context.Context, request *[]string) (*TaskInfo, error) // ResetFilterableAttributes resets the filterable attributes of the index to default values. ResetFilterableAttributes() (*TaskInfo, error) // ResetFilterableAttributesWithContext resets the filterable attributes of the index to default values using the provided context for cancellation. ResetFilterableAttributesWithContext(ctx context.Context) (*TaskInfo, error) // UpdateSortableAttributes updates the sortable attributes of the index. UpdateSortableAttributes(request *[]string) (*TaskInfo, error) // UpdateSortableAttributesWithContext updates the sortable attributes of the index using the provided context for cancellation. UpdateSortableAttributesWithContext(ctx context.Context, request *[]string) (*TaskInfo, error) // ResetSortableAttributes resets the sortable attributes of the index to default values. ResetSortableAttributes() (*TaskInfo, error) // ResetSortableAttributesWithContext resets the sortable attributes of the index to default values using the provided context for cancellation. ResetSortableAttributesWithContext(ctx context.Context) (*TaskInfo, error) // UpdateTypoTolerance updates the typo tolerance settings of the index. UpdateTypoTolerance(request *TypoTolerance) (*TaskInfo, error) // UpdateTypoToleranceWithContext updates the typo tolerance settings of the index using the provided context for cancellation. UpdateTypoToleranceWithContext(ctx context.Context, request *TypoTolerance) (*TaskInfo, error) // ResetTypoTolerance resets the typo tolerance settings of the index to default values. ResetTypoTolerance() (*TaskInfo, error) // ResetTypoToleranceWithContext resets the typo tolerance settings of the index to default values using the provided context for cancellation. ResetTypoToleranceWithContext(ctx context.Context) (*TaskInfo, error) // UpdatePagination updates the pagination settings of the index. UpdatePagination(request *Pagination) (*TaskInfo, error) // UpdatePaginationWithContext updates the pagination settings of the index using the provided context for cancellation. UpdatePaginationWithContext(ctx context.Context, request *Pagination) (*TaskInfo, error) // ResetPagination resets the pagination settings of the index to default values. ResetPagination() (*TaskInfo, error) // ResetPaginationWithContext resets the pagination settings of the index to default values using the provided context for cancellation. ResetPaginationWithContext(ctx context.Context) (*TaskInfo, error) // UpdateFaceting updates the faceting settings of the index. UpdateFaceting(request *Faceting) (*TaskInfo, error) // UpdateFacetingWithContext updates the faceting settings of the index using the provided context for cancellation. UpdateFacetingWithContext(ctx context.Context, request *Faceting) (*TaskInfo, error) // ResetFaceting resets the faceting settings of the index to default values. ResetFaceting() (*TaskInfo, error) // ResetFacetingWithContext resets the faceting settings of the index to default values using the provided context for cancellation. ResetFacetingWithContext(ctx context.Context) (*TaskInfo, error) // UpdateEmbedders updates the embedders of the index. UpdateEmbedders(request map[string]Embedder) (*TaskInfo, error) // UpdateEmbeddersWithContext updates the embedders of the index using the provided context for cancellation. UpdateEmbeddersWithContext(ctx context.Context, request map[string]Embedder) (*TaskInfo, error) // ResetEmbedders resets the embedders of the index to default values. ResetEmbedders() (*TaskInfo, error) // ResetEmbeddersWithContext resets the embedders of the index to default values using the provided context for cancellation. ResetEmbeddersWithContext(ctx context.Context) (*TaskInfo, error) // UpdateSearchCutoffMs updates the search cutoff time in milliseconds. UpdateSearchCutoffMs(request int64) (*TaskInfo, error) // UpdateSearchCutoffMsWithContext updates the search cutoff time in milliseconds using the provided context for cancellation. UpdateSearchCutoffMsWithContext(ctx context.Context, request int64) (*TaskInfo, error) // ResetSearchCutoffMs resets the search cutoff time in milliseconds to default value. ResetSearchCutoffMs() (*TaskInfo, error) // ResetSearchCutoffMsWithContext resets the search cutoff time in milliseconds to default value using the provided context for cancellation. ResetSearchCutoffMsWithContext(ctx context.Context) (*TaskInfo, error) // UpdateSeparatorTokens update separator tokens // https://www.meilisearch.com/docs/reference/api/settings#update-separator-tokens UpdateSeparatorTokens(tokens []string) (*TaskInfo, error) // UpdateSeparatorTokensWithContext update separator tokens and support parent context // https://www.meilisearch.com/docs/reference/api/settings#update-separator-tokens UpdateSeparatorTokensWithContext(ctx context.Context, tokens []string) (*TaskInfo, error) // ResetSeparatorTokens reset separator tokens // https://www.meilisearch.com/docs/reference/api/settings#reset-separator-tokens ResetSeparatorTokens() (*TaskInfo, error) // ResetSeparatorTokensWithContext reset separator tokens and support parent context // https://www.meilisearch.com/docs/reference/api/settings#reset-separator-tokens ResetSeparatorTokensWithContext(ctx context.Context) (*TaskInfo, error) // UpdateNonSeparatorTokens update non-separator tokens // https://www.meilisearch.com/docs/reference/api/settings#update-non-separator-tokens UpdateNonSeparatorTokens(tokens []string) (*TaskInfo, error) // UpdateNonSeparatorTokensWithContext update non-separator tokens and support parent context // https://www.meilisearch.com/docs/reference/api/settings#update-non-separator-tokens UpdateNonSeparatorTokensWithContext(ctx context.Context, tokens []string) (*TaskInfo, error) // ResetNonSeparatorTokens reset non-separator tokens // https://www.meilisearch.com/docs/reference/api/settings#reset-non-separator-tokens ResetNonSeparatorTokens() (*TaskInfo, error) // ResetNonSeparatorTokensWithContext reset non-separator tokens and support parent context // https://www.meilisearch.com/docs/reference/api/settings#reset-non-separator-tokens ResetNonSeparatorTokensWithContext(ctx context.Context) (*TaskInfo, error) // UpdateDictionary update user dictionary // https://www.meilisearch.com/docs/reference/api/settings#update-dictionary UpdateDictionary(words []string) (*TaskInfo, error) // UpdateDictionaryWithContext update user dictionary and support parent context // https://www.meilisearch.com/docs/reference/api/settings#update-dictionary UpdateDictionaryWithContext(ctx context.Context, words []string) (*TaskInfo, error) // ResetDictionary reset user dictionary // https://www.meilisearch.com/docs/reference/api/settings#reset-dictionary ResetDictionary() (*TaskInfo, error) // ResetDictionaryWithContext reset user dictionary and support parent context // https://www.meilisearch.com/docs/reference/api/settings#reset-dictionary ResetDictionaryWithContext(ctx context.Context) (*TaskInfo, error) // UpdateProximityPrecision set ProximityPrecision value ByWord or ByAttribute // https://www.meilisearch.com/docs/reference/api/settings#update-proximity-precision-settings UpdateProximityPrecision(proximityType ProximityPrecisionType) (*TaskInfo, error) // UpdateProximityPrecisionWithContext set ProximityPrecision value ByWord or ByAttribute and support parent context // https://www.meilisearch.com/docs/reference/api/settings#update-proximity-precision-settings UpdateProximityPrecisionWithContext(ctx context.Context, proximityType ProximityPrecisionType) (*TaskInfo, error) // ResetProximityPrecision reset ProximityPrecision to default ByWord // https://www.meilisearch.com/docs/reference/api/settings#reset-proximity-precision-settings ResetProximityPrecision() (*TaskInfo, error) // ResetProximityPrecisionWithContext reset ProximityPrecision to default ByWord and support parent context // https://www.meilisearch.com/docs/reference/api/settings#reset-proximity-precision-settings ResetProximityPrecisionWithContext(ctx context.Context) (*TaskInfo, error) // UpdateLocalizedAttributes update the localized attributes settings of an index // https://www.meilisearch.com/docs/reference/api/settings#update-localized-attribute-settings UpdateLocalizedAttributes(request []*LocalizedAttributes) (*TaskInfo, error) // UpdateLocalizedAttributesWithContext update the localized attributes settings of an index using the provided context for cancellation // https://www.meilisearch.com/docs/reference/api/settings#update-localized-attribute-settings UpdateLocalizedAttributesWithContext(ctx context.Context, request []*LocalizedAttributes) (*TaskInfo, error) // ResetLocalizedAttributes reset the localized attributes settings ResetLocalizedAttributes() (*TaskInfo, error) // ResetLocalizedAttributesWithContext reset the localized attributes settings using the provided context for cancellation ResetLocalizedAttributesWithContext(ctx context.Context) (*TaskInfo, error) }
type SettingsReader ΒΆ
type SettingsReader interface { // GetSettings retrieves the settings of the index. GetSettings() (*Settings, error) // GetSettingsWithContext retrieves the settings of the index using the provided context for cancellation. GetSettingsWithContext(ctx context.Context) (*Settings, error) // GetRankingRules retrieves the ranking rules of the index. GetRankingRules() (*[]string, error) // GetRankingRulesWithContext retrieves the ranking rules of the index using the provided context for cancellation. GetRankingRulesWithContext(ctx context.Context) (*[]string, error) // GetDistinctAttribute retrieves the distinct attribute of the index. GetDistinctAttribute() (*string, error) // GetDistinctAttributeWithContext retrieves the distinct attribute of the index using the provided context for cancellation. GetDistinctAttributeWithContext(ctx context.Context) (*string, error) // GetSearchableAttributes retrieves the searchable attributes of the index. GetSearchableAttributes() (*[]string, error) // GetSearchableAttributesWithContext retrieves the searchable attributes of the index using the provided context for cancellation. GetSearchableAttributesWithContext(ctx context.Context) (*[]string, error) // GetDisplayedAttributes retrieves the displayed attributes of the index. GetDisplayedAttributes() (*[]string, error) // GetDisplayedAttributesWithContext retrieves the displayed attributes of the index using the provided context for cancellation. GetDisplayedAttributesWithContext(ctx context.Context) (*[]string, error) // GetStopWords retrieves the stop words of the index. GetStopWords() (*[]string, error) // GetStopWordsWithContext retrieves the stop words of the index using the provided context for cancellation. GetStopWordsWithContext(ctx context.Context) (*[]string, error) // GetSynonyms retrieves the synonyms of the index. GetSynonyms() (*map[string][]string, error) // GetSynonymsWithContext retrieves the synonyms of the index using the provided context for cancellation. GetSynonymsWithContext(ctx context.Context) (*map[string][]string, error) // GetFilterableAttributes retrieves the filterable attributes of the index. GetFilterableAttributes() (*[]string, error) // GetFilterableAttributesWithContext retrieves the filterable attributes of the index using the provided context for cancellation. GetFilterableAttributesWithContext(ctx context.Context) (*[]string, error) // GetSortableAttributes retrieves the sortable attributes of the index. GetSortableAttributes() (*[]string, error) // GetSortableAttributesWithContext retrieves the sortable attributes of the index using the provided context for cancellation. GetSortableAttributesWithContext(ctx context.Context) (*[]string, error) // GetTypoTolerance retrieves the typo tolerance settings of the index. GetTypoTolerance() (*TypoTolerance, error) // GetTypoToleranceWithContext retrieves the typo tolerance settings of the index using the provided context for cancellation. GetTypoToleranceWithContext(ctx context.Context) (*TypoTolerance, error) // GetPagination retrieves the pagination settings of the index. GetPagination() (*Pagination, error) // GetPaginationWithContext retrieves the pagination settings of the index using the provided context for cancellation. GetPaginationWithContext(ctx context.Context) (*Pagination, error) // GetFaceting retrieves the faceting settings of the index. GetFaceting() (*Faceting, error) // GetFacetingWithContext retrieves the faceting settings of the index using the provided context for cancellation. GetFacetingWithContext(ctx context.Context) (*Faceting, error) // GetEmbedders retrieves the embedders of the index. GetEmbedders() (map[string]Embedder, error) // GetEmbeddersWithContext retrieves the embedders of the index using the provided context for cancellation. GetEmbeddersWithContext(ctx context.Context) (map[string]Embedder, error) // GetSearchCutoffMs retrieves the search cutoff time in milliseconds. GetSearchCutoffMs() (int64, error) // GetSearchCutoffMsWithContext retrieves the search cutoff time in milliseconds using the provided context for cancellation. GetSearchCutoffMsWithContext(ctx context.Context) (int64, error) // GetSeparatorTokens returns separators tokens // https://www.meilisearch.com/docs/reference/api/settings#get-separator-tokens GetSeparatorTokens() ([]string, error) // GetSeparatorTokensWithContext returns separator tokens and support parent context // https://www.meilisearch.com/docs/reference/api/settings#get-separator-tokens GetSeparatorTokensWithContext(ctx context.Context) ([]string, error) // GetNonSeparatorTokens returns non-separator tokens // https://www.meilisearch.com/docs/reference/api/settings#get-non-separator-tokens GetNonSeparatorTokens() ([]string, error) // GetNonSeparatorTokensWithContext returns non-separator tokens and support parent context // https://www.meilisearch.com/docs/reference/api/settings#get-non-separator-tokens GetNonSeparatorTokensWithContext(ctx context.Context) ([]string, error) // GetDictionary returns user dictionary // //Allows users to instruct Meilisearch to consider groups of strings as a //single term by adding a supplementary dictionary of user-defined terms. //This is particularly useful when working with datasets containing many domain-specific //words, and in languages where words are not separated by whitespace such as Japanese. //Custom dictionaries are also useful in a few use-cases for space-separated languages, //such as datasets with names such as "J. R. R. Tolkien" and "W. E. B. Du Bois". // // https://www.meilisearch.com/docs/reference/api/settings#get-dictionary GetDictionary() ([]string, error) // GetDictionaryWithContext returns user dictionary and support parent context // //Allows users to instruct Meilisearch to consider groups of strings as a //single term by adding a supplementary dictionary of user-defined terms. //This is particularly useful when working with datasets containing many domain-specific //words, and in languages where words are not separated by whitespace such as Japanese. //Custom dictionaries are also useful in a few use-cases for space-separated languages, //such as datasets with names such as "J. R. R. Tolkien" and "W. E. B. Du Bois". // // https://www.meilisearch.com/docs/reference/api/settings#get-dictionary GetDictionaryWithContext(ctx context.Context) ([]string, error) // GetProximityPrecision returns ProximityPrecision configuration value // https://www.meilisearch.com/docs/reference/api/settings#get-proximity-precision-settings GetProximityPrecision() (ProximityPrecisionType, error) // GetProximityPrecisionWithContext returns ProximityPrecision configuration value and support parent context // https://www.meilisearch.com/docs/reference/api/settings#get-proximity-precision-settings GetProximityPrecisionWithContext(ctx context.Context) (ProximityPrecisionType, error) // GetLocalizedAttributes get the localized attributes settings of an index // https://www.meilisearch.com/docs/reference/api/settings#get-localized-attributes-settings GetLocalizedAttributes() ([]*LocalizedAttributes, error) // GetLocalizedAttributesWithContext get the localized attributes settings of an index using the provided context for cancellation // https://www.meilisearch.com/docs/reference/api/settings#get-localized-attributes-settings GetLocalizedAttributesWithContext(ctx context.Context) ([]*LocalizedAttributes, error) }
type SimilarDocumentQuery ΒΆ
type SimilarDocumentQuery struct { Id interface{} `json:"id,omitempty"` Embedder string `json:"embedder"` AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"` Offset int64 `json:"offset,omitempty"` Limit int64 `json:"limit,omitempty"` Filter string `json:"filter,omitempty"` ShowRankingScore bool `json:"showRankingScore,omitempty"` ShowRankingScoreDetails bool `json:"showRankingScoreDetails,omitempty"` RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"` RetrieveVectors bool `json:"retrieveVectors,omitempty"` }
SimilarDocumentQuery is query parameters of similar documents
func (SimilarDocumentQuery) MarshalEasyJSON ΒΆ
func (v SimilarDocumentQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SimilarDocumentQuery) MarshalJSON ΒΆ
func (v SimilarDocumentQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SimilarDocumentQuery) UnmarshalEasyJSON ΒΆ
func (v *SimilarDocumentQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SimilarDocumentQuery) UnmarshalJSON ΒΆ
func (v *SimilarDocumentQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SimilarDocumentResult ΒΆ
type SimilarDocumentResult struct { Hits []interface{} `json:"hits,omitempty"` ID string `json:"id,omitempty"` ProcessingTimeMS int64 `json:"processingTimeMs,omitempty"` Limit int64 `json:"limit,omitempty"` Offset int64 `json:"offset,omitempty"` EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"` }
func (SimilarDocumentResult) MarshalEasyJSON ΒΆ
func (v SimilarDocumentResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SimilarDocumentResult) MarshalJSON ΒΆ
func (v SimilarDocumentResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SimilarDocumentResult) UnmarshalEasyJSON ΒΆ
func (v *SimilarDocumentResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SimilarDocumentResult) UnmarshalJSON ΒΆ
func (v *SimilarDocumentResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SortFacetType ΒΆ
type SortFacetType string // SortFacetType is type of facet sorting, alpha or count
const ( SortFacetTypeAlpha SortFacetType = "alpha" SortFacetTypeCount SortFacetType = "count" )
type Stats ΒΆ
type Stats struct { DatabaseSize int64 `json:"databaseSize"` LastUpdate time.Time `json:"lastUpdate"` Indexes map[string]StatsIndex `json:"indexes"` }
Stats is the type that represent all stats
func (Stats) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Stats) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Stats) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Stats) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type StatsIndex ΒΆ
type StatsIndex struct { NumberOfDocuments int64 `json:"numberOfDocuments"` IsIndexing bool `json:"isIndexing"` FieldDistribution map[string]int64 `json:"fieldDistribution"` }
StatsIndex is the type that represent the stats of an index in meilisearch
func (StatsIndex) MarshalEasyJSON ΒΆ
func (v StatsIndex) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StatsIndex) MarshalJSON ΒΆ
func (v StatsIndex) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StatsIndex) UnmarshalEasyJSON ΒΆ
func (v *StatsIndex) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StatsIndex) UnmarshalJSON ΒΆ
func (v *StatsIndex) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SwapIndexesParams ΒΆ
type SwapIndexesParams struct {
Indexes []string `json:"indexes"`
}
func (SwapIndexesParams) MarshalEasyJSON ΒΆ
func (v SwapIndexesParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SwapIndexesParams) MarshalJSON ΒΆ
func (v SwapIndexesParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SwapIndexesParams) UnmarshalEasyJSON ΒΆ
func (v *SwapIndexesParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SwapIndexesParams) UnmarshalJSON ΒΆ
func (v *SwapIndexesParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Task ΒΆ
type Task struct { Status TaskStatus `json:"status"` UID int64 `json:"uid,omitempty"` TaskUID int64 `json:"taskUid,omitempty"` IndexUID string `json:"indexUid"` Type TaskType `json:"type"` Error meilisearchApiError `json:"error,omitempty"` Duration string `json:"duration,omitempty"` EnqueuedAt time.Time `json:"enqueuedAt"` StartedAt time.Time `json:"startedAt,omitempty"` FinishedAt time.Time `json:"finishedAt,omitempty"` Details Details `json:"details,omitempty"` CanceledBy int64 `json:"canceledBy,omitempty"` }
Task indicates information about a task resource
Documentation: https://www.meilisearch.com/docs/learn/advanced/asynchronous_operations
func (Task) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Task) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Task) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Task) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type TaskInfo ΒΆ
type TaskInfo struct { Status TaskStatus `json:"status"` TaskUID int64 `json:"taskUid"` IndexUID string `json:"indexUid"` Type TaskType `json:"type"` EnqueuedAt time.Time `json:"enqueuedAt"` }
TaskInfo indicates information regarding a task returned by an asynchronous method
Documentation: https://www.meilisearch.com/docs/reference/api/tasks#tasks
func (TaskInfo) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (TaskInfo) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*TaskInfo) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TaskInfo) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type TaskManager ΒΆ
type TaskManager interface { TaskReader // CancelTasks cancels specific tasks. CancelTasks(param *CancelTasksQuery) (*TaskInfo, error) // CancelTasksWithContext cancels specific tasks with a context for cancellation. CancelTasksWithContext(ctx context.Context, param *CancelTasksQuery) (*TaskInfo, error) // DeleteTasks deletes specific tasks. DeleteTasks(param *DeleteTasksQuery) (*TaskInfo, error) // DeleteTasksWithContext deletes specific tasks with a context for cancellation. DeleteTasksWithContext(ctx context.Context, param *DeleteTasksQuery) (*TaskInfo, error) }
type TaskReader ΒΆ
type TaskReader interface { // GetTask retrieves a task by its UID. GetTask(taskUID int64) (*Task, error) // GetTaskWithContext retrieves a task by its UID using the provided context for cancellation. GetTaskWithContext(ctx context.Context, taskUID int64) (*Task, error) // GetTasks retrieves multiple tasks based on query parameters. GetTasks(param *TasksQuery) (*TaskResult, error) // GetTasksWithContext retrieves multiple tasks based on query parameters using the provided context for cancellation. GetTasksWithContext(ctx context.Context, param *TasksQuery) (*TaskResult, error) // WaitForTask waits for a task to complete by its UID with the given interval. WaitForTask(taskUID int64, interval time.Duration) (*Task, error) // WaitForTaskWithContext waits for a task to complete by its UID with the given interval using the provided context for cancellation. WaitForTaskWithContext(ctx context.Context, taskUID int64, interval time.Duration) (*Task, error) }
type TaskResult ΒΆ
type TaskResult struct { Results []Task `json:"results"` Limit int64 `json:"limit"` From int64 `json:"from"` Next int64 `json:"next"` Total int64 `json:"total"` }
TaskResult return of multiple tasks is wrap in a TaskResult
func (TaskResult) MarshalEasyJSON ΒΆ
func (v TaskResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TaskResult) MarshalJSON ΒΆ
func (v TaskResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TaskResult) UnmarshalEasyJSON ΒΆ
func (v *TaskResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TaskResult) UnmarshalJSON ΒΆ
func (v *TaskResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TaskStatus ΒΆ
type TaskStatus string // TaskStatus is the status of a task.
const ( // TaskStatusUnknown is the default TaskStatus, should not exist TaskStatusUnknown TaskStatus = "unknown" // TaskStatusEnqueued the task request has been received and will be processed soon TaskStatusEnqueued TaskStatus = "enqueued" // TaskStatusProcessing the task is being processed TaskStatusProcessing TaskStatus = "processing" // TaskStatusSucceeded the task has been successfully processed TaskStatusSucceeded TaskStatus = "succeeded" // TaskStatusFailed a failure occurred when processing the task, no changes were made to the database TaskStatusFailed TaskStatus = "failed" // TaskStatusCanceled the task was canceled TaskStatusCanceled TaskStatus = "canceled" )
type TaskType ΒΆ
type TaskType string // TaskType is the type of a task
const ( // TaskTypeIndexCreation represents an index creation TaskTypeIndexCreation TaskType = "indexCreation" // TaskTypeIndexUpdate represents an index update TaskTypeIndexUpdate TaskType = "indexUpdate" // TaskTypeIndexDeletion represents an index deletion TaskTypeIndexDeletion TaskType = "indexDeletion" // TaskTypeIndexSwap represents an index swap TaskTypeIndexSwap TaskType = "indexSwap" // TaskTypeDocumentAdditionOrUpdate represents a document addition or update in an index TaskTypeDocumentAdditionOrUpdate TaskType = "documentAdditionOrUpdate" // TaskTypeDocumentDeletion represents a document deletion from an index TaskTypeDocumentDeletion TaskType = "documentDeletion" // TaskTypeSettingsUpdate represents a settings update TaskTypeSettingsUpdate TaskType = "settingsUpdate" // TaskTypeDumpCreation represents a dump creation TaskTypeDumpCreation TaskType = "dumpCreation" // TaskTypeTaskCancelation represents a task cancelation TaskTypeTaskCancelation TaskType = "taskCancelation" // TaskTypeTaskDeletion represents a task deletion TaskTypeTaskDeletion TaskType = "taskDeletion" // TaskTypeSnapshotCreation represents a snapshot creation TaskTypeSnapshotCreation TaskType = "snapshotCreation" )
type TasksQuery ΒΆ
type TasksQuery struct { UIDS []int64 Limit int64 From int64 IndexUIDS []string Statuses []TaskStatus Types []TaskType CanceledBy []int64 BeforeEnqueuedAt time.Time AfterEnqueuedAt time.Time BeforeStartedAt time.Time AfterStartedAt time.Time BeforeFinishedAt time.Time AfterFinishedAt time.Time Reverse bool }
TasksQuery is a list of filter available to send as query parameters
func (TasksQuery) MarshalEasyJSON ΒΆ
func (v TasksQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TasksQuery) MarshalJSON ΒΆ
func (v TasksQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TasksQuery) UnmarshalEasyJSON ΒΆ
func (v *TasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TasksQuery) UnmarshalJSON ΒΆ
func (v *TasksQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TenantTokenClaims ΒΆ
type TenantTokenClaims struct { APIKeyUID string `json:"apiKeyUid"` SearchRules interface{} `json:"searchRules"` jwt.RegisteredClaims }
TenantTokenClaims custom Claims structure to create a Tenant Token
func (TenantTokenClaims) MarshalEasyJSON ΒΆ
func (v TenantTokenClaims) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TenantTokenClaims) MarshalJSON ΒΆ
func (v TenantTokenClaims) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TenantTokenClaims) UnmarshalEasyJSON ΒΆ
func (v *TenantTokenClaims) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TenantTokenClaims) UnmarshalJSON ΒΆ
func (v *TenantTokenClaims) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TenantTokenOptions ΒΆ
TenantTokenOptions information to create a tenant token
ExpiresAt is a time.Time when the key will expire. Note that if an ExpiresAt value is included it should be in UTC time. ApiKey is the API key parent of the token.
func (TenantTokenOptions) MarshalEasyJSON ΒΆ
func (v TenantTokenOptions) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TenantTokenOptions) MarshalJSON ΒΆ
func (v TenantTokenOptions) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TenantTokenOptions) UnmarshalEasyJSON ΒΆ
func (v *TenantTokenOptions) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TenantTokenOptions) UnmarshalJSON ΒΆ
func (v *TenantTokenOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TypoTolerance ΒΆ
type TypoTolerance struct { Enabled bool `json:"enabled"` MinWordSizeForTypos MinWordSizeForTypos `json:"minWordSizeForTypos,omitempty"` DisableOnWords []string `json:"disableOnWords,omitempty"` DisableOnAttributes []string `json:"disableOnAttributes,omitempty"` }
TypoTolerance is the type that represents the typo tolerance setting in meilisearch
func (TypoTolerance) MarshalEasyJSON ΒΆ
func (v TypoTolerance) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TypoTolerance) MarshalJSON ΒΆ
func (v TypoTolerance) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TypoTolerance) UnmarshalEasyJSON ΒΆ
func (v *TypoTolerance) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TypoTolerance) UnmarshalJSON ΒΆ
func (v *TypoTolerance) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UpdateDocumentByFunctionRequest ΒΆ
type UpdateDocumentByFunctionRequest struct { Filter string `json:"filter,omitempty"` Function string `json:"function"` Context map[string]interface{} `json:"context,omitempty"` }
func (UpdateDocumentByFunctionRequest) MarshalEasyJSON ΒΆ
func (v UpdateDocumentByFunctionRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UpdateDocumentByFunctionRequest) MarshalJSON ΒΆ
func (v UpdateDocumentByFunctionRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UpdateDocumentByFunctionRequest) UnmarshalEasyJSON ΒΆ
func (v *UpdateDocumentByFunctionRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdateDocumentByFunctionRequest) UnmarshalJSON ΒΆ
func (v *UpdateDocumentByFunctionRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UpdateIndexRequest ΒΆ
type UpdateIndexRequest struct {
PrimaryKey string `json:"primaryKey"`
}
UpdateIndexRequest is the request body for update Index primary key
func (UpdateIndexRequest) MarshalEasyJSON ΒΆ
func (v UpdateIndexRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UpdateIndexRequest) MarshalJSON ΒΆ
func (v UpdateIndexRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UpdateIndexRequest) UnmarshalEasyJSON ΒΆ
func (v *UpdateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdateIndexRequest) UnmarshalJSON ΒΆ
func (v *UpdateIndexRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Version ΒΆ
type Version struct { CommitSha string `json:"commitSha"` CommitDate string `json:"commitDate"` PkgVersion string `json:"pkgVersion"` }
Version is the type that represents the versions in meilisearch
func (Version) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (Version) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*Version) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Version) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface