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 DocumentQuery
- 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) SetVectorStore(vectorStore 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 IndexResult
- type IndexesQuery
- type IndexesResults
- type Key
- type KeyParsed
- 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 SearchRequest
- type SearchRequestHybrid
- type SearchResponse
- type ServiceManager
- type Settings
- type SimilarDocumentQuery
- type SimilarDocumentResult
- type SortFacetType
- type Stats
- type StatsIndex
- type SwapIndexesParams
- type Task
- type TaskInfo
- type TaskResult
- type TaskStatus
- type TaskType
- type TasksQuery
- type TenantTokenClaims
- type TenantTokenOptions
- type TypoTolerance
- type Unknown
- 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.29.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 ΒΆ added in v0.19.1
func GetQualifiedVersion() (qualifiedVersion string)
func IsValidUUID ΒΆ added in v0.20.0
func VersionErrorHintMessage ΒΆ added in v0.25.0
VersionErrorHintMessage a hint to the error message if it may come from a version incompatibility with meilisearch
Types ΒΆ
type CancelTasksQuery ΒΆ added in v0.22.0
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 ΒΆ added in v0.22.0
func (v CancelTasksQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelTasksQuery) MarshalJSON ΒΆ added in v0.22.0
func (v CancelTasksQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelTasksQuery) UnmarshalEasyJSON ΒΆ added in v0.22.0
func (v *CancelTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelTasksQuery) UnmarshalJSON ΒΆ added in v0.22.0
func (v *CancelTasksQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ContentEncoding ΒΆ added in v0.29.0
type ContentEncoding string
func (ContentEncoding) IsZero ΒΆ added in v0.29.0
func (c ContentEncoding) IsZero() bool
func (ContentEncoding) String ΒΆ added in v0.29.0
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 ΒΆ added in v0.13.1
func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateIndexRequest) MarshalJSON ΒΆ added in v0.13.1
func (v CreateIndexRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateIndexRequest) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateIndexRequest) UnmarshalJSON ΒΆ added in v0.13.1
func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CsvDocumentsQuery ΒΆ added in v0.24.0
type CsvDocumentsQuery struct {
PrimaryKey string `json:"primaryKey,omitempty"`
CsvDelimiter string `json:"csvDelimiter,omitempty"`
}
func (CsvDocumentsQuery) MarshalEasyJSON ΒΆ added in v0.24.0
func (v CsvDocumentsQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CsvDocumentsQuery) MarshalJSON ΒΆ added in v0.24.0
func (v CsvDocumentsQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CsvDocumentsQuery) UnmarshalEasyJSON ΒΆ added in v0.24.0
func (v *CsvDocumentsQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CsvDocumentsQuery) UnmarshalJSON ΒΆ added in v0.24.0
func (v *CsvDocumentsQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DeleteTasksQuery ΒΆ added in v0.22.0
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 ΒΆ added in v0.22.0
func (v DeleteTasksQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DeleteTasksQuery) MarshalJSON ΒΆ added in v0.22.0
func (v DeleteTasksQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DeleteTasksQuery) UnmarshalEasyJSON ΒΆ added in v0.22.0
func (v *DeleteTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DeleteTasksQuery) UnmarshalJSON ΒΆ added in v0.22.0
func (v *DeleteTasksQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Details ΒΆ added in v0.18.0
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 ΒΆ added in v0.18.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Details) MarshalJSON ΒΆ added in v0.18.0
MarshalJSON supports json.Marshaler interface
func (*Details) UnmarshalEasyJSON ΒΆ added in v0.18.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Details) UnmarshalJSON ΒΆ added in v0.18.0
UnmarshalJSON supports json.Unmarshaler interface
type DocumentQuery ΒΆ added in v0.20.0
type DocumentQuery struct {
Fields []string `json:"fields,omitempty"`
}
DocumentQuery is the request body get one documents method
func (DocumentQuery) MarshalEasyJSON ΒΆ added in v0.20.0
func (v DocumentQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DocumentQuery) MarshalJSON ΒΆ added in v0.20.0
func (v DocumentQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DocumentQuery) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *DocumentQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DocumentQuery) UnmarshalJSON ΒΆ added in v0.20.0
func (v *DocumentQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DocumentsQuery ΒΆ added in v0.20.0
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 ΒΆ added in v0.20.0
func (v DocumentsQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DocumentsQuery) MarshalJSON ΒΆ added in v0.20.0
func (v DocumentsQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DocumentsQuery) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *DocumentsQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DocumentsQuery) UnmarshalJSON ΒΆ added in v0.20.0
func (v *DocumentsQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DocumentsResult ΒΆ added in v0.20.0
type DocumentsResult struct {
Results []map[string]interface{} `json:"results"`
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
Total int64 `json:"total"`
}
func (DocumentsResult) MarshalEasyJSON ΒΆ added in v0.20.0
func (v DocumentsResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DocumentsResult) MarshalJSON ΒΆ added in v0.20.0
func (v DocumentsResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DocumentsResult) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *DocumentsResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DocumentsResult) UnmarshalJSON ΒΆ added in v0.20.0
func (v *DocumentsResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Embedder ΒΆ added in v0.26.3
type Embedder struct {
Source string `json:"source"`
URL string `json:"url,omitempty"`
ApiKey string `json:"apiKey,omitempty"`
Model string `json:"model,omitempty"`
Dimensions int `json:"dimensions,omitempty"`
DocumentTemplate string `json:"documentTemplate,omitempty"`
}
func (Embedder) MarshalEasyJSON ΒΆ added in v0.26.3
MarshalEasyJSON supports easyjson.Marshaler interface
func (Embedder) MarshalJSON ΒΆ added in v0.26.3
MarshalJSON supports json.Marshaler interface
func (*Embedder) UnmarshalEasyJSON ΒΆ added in v0.26.3
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Embedder) UnmarshalJSON ΒΆ added in v0.26.3
UnmarshalJSON supports json.Unmarshaler interface
type EncodingCompressionLevel ΒΆ added in v0.29.0
type EncodingCompressionLevel int
func (EncodingCompressionLevel) Int ΒΆ added in v0.29.0
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 ΒΆ added in v0.29.0
type ExperimentalFeatures struct {
ExperimentalFeaturesBase
// contains filtered or unexported fields
}
Type for experimental features with additional client field
func (*ExperimentalFeatures) Get ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) Get() (*ExperimentalFeaturesResult, error)
func (*ExperimentalFeatures) GetWithContext ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) GetWithContext(ctx context.Context) (*ExperimentalFeaturesResult, error)
func (*ExperimentalFeatures) SetContainsFilter ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) SetContainsFilter(containsFilter bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetEditDocumentsByFunction ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) SetEditDocumentsByFunction(editDocumentsByFunction bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetLogsRoute ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) SetLogsRoute(logsRoute bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetMetrics ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) SetMetrics(metrics bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetVectorStore ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) SetVectorStore(vectorStore bool) *ExperimentalFeatures
func (*ExperimentalFeatures) Update ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) Update() (*ExperimentalFeaturesResult, error)
func (*ExperimentalFeatures) UpdateWithContext ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) UpdateWithContext(ctx context.Context) (*ExperimentalFeaturesResult, error)
type ExperimentalFeaturesBase ΒΆ added in v0.29.0
type ExperimentalFeaturesBase struct {
VectorStore *bool `json:"vectorStore,omitempty"`
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 ΒΆ added in v0.29.0
func (v ExperimentalFeaturesBase) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ExperimentalFeaturesBase) MarshalJSON ΒΆ added in v0.29.0
func (v ExperimentalFeaturesBase) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ExperimentalFeaturesBase) UnmarshalEasyJSON ΒΆ added in v0.29.0
func (v *ExperimentalFeaturesBase) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ExperimentalFeaturesBase) UnmarshalJSON ΒΆ added in v0.29.0
func (v *ExperimentalFeaturesBase) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ExperimentalFeaturesResult ΒΆ added in v0.29.0
type ExperimentalFeaturesResult struct {
VectorStore bool `json:"vectorStore"`
LogsRoute bool `json:"logsRoute"`
Metrics bool `json:"metrics"`
EditDocumentsByFunction bool `json:"editDocumentsByFunction"`
ContainsFilter bool `json:"containsFilter"`
}
func (ExperimentalFeaturesResult) MarshalEasyJSON ΒΆ added in v0.29.0
func (v ExperimentalFeaturesResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ExperimentalFeaturesResult) MarshalJSON ΒΆ added in v0.29.0
func (v ExperimentalFeaturesResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ExperimentalFeaturesResult) UnmarshalEasyJSON ΒΆ added in v0.29.0
func (v *ExperimentalFeaturesResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ExperimentalFeaturesResult) UnmarshalJSON ΒΆ added in v0.29.0
func (v *ExperimentalFeaturesResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FacetSearchRequest ΒΆ added in v0.27.1
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 ΒΆ added in v0.27.1
func (v FacetSearchRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FacetSearchRequest) MarshalJSON ΒΆ added in v0.27.1
func (v FacetSearchRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FacetSearchRequest) UnmarshalEasyJSON ΒΆ added in v0.27.1
func (v *FacetSearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FacetSearchRequest) UnmarshalJSON ΒΆ added in v0.27.1
func (v *FacetSearchRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FacetSearchResponse ΒΆ added in v0.27.1
type FacetSearchResponse struct {
FacetHits []interface{} `json:"facetHits"`
FacetQuery string `json:"facetQuery"`
ProcessingTimeMs int64 `json:"processingTimeMs"`
}
func (FacetSearchResponse) MarshalEasyJSON ΒΆ added in v0.27.1
func (v FacetSearchResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FacetSearchResponse) MarshalJSON ΒΆ added in v0.27.1
func (v FacetSearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FacetSearchResponse) UnmarshalEasyJSON ΒΆ added in v0.27.1
func (v *FacetSearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FacetSearchResponse) UnmarshalJSON ΒΆ added in v0.27.1
func (v *FacetSearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Faceting ΒΆ added in v0.20.1
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 ΒΆ added in v0.20.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Faceting) MarshalJSON ΒΆ added in v0.20.1
MarshalJSON supports json.Marshaler interface
func (*Faceting) UnmarshalEasyJSON ΒΆ added in v0.20.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Faceting) UnmarshalJSON ΒΆ added in v0.20.1
UnmarshalJSON supports json.Unmarshaler interface
type Health ΒΆ added in v0.13.1
type Health struct {
Status string `json:"status"`
}
Health is the request body for set meilisearch health
func (Health) MarshalEasyJSON ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Health) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Health) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Health) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
type IndexConfig ΒΆ added in v0.15.0
type IndexConfig struct {
// Uid is the unique identifier of a given index.
Uid string
// PrimaryKey is optional
PrimaryKey string
}
func (IndexConfig) MarshalEasyJSON ΒΆ added in v0.28.0
func (v IndexConfig) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexConfig) MarshalJSON ΒΆ added in v0.28.0
func (v IndexConfig) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexConfig) UnmarshalEasyJSON ΒΆ added in v0.28.0
func (v *IndexConfig) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexConfig) UnmarshalJSON ΒΆ added in v0.28.0
func (v *IndexConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type IndexManager ΒΆ added in v0.28.0
type IndexManager 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)
// 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)
// 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)
// 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)
// 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
// 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)
// 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
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// 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 IndexResult ΒΆ added in v0.28.0
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 ΒΆ added in v0.28.0
func (v IndexResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexResult) MarshalJSON ΒΆ added in v0.28.0
func (v IndexResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexResult) UnmarshalEasyJSON ΒΆ added in v0.28.0
func (v *IndexResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexResult) UnmarshalJSON ΒΆ added in v0.28.0
func (v *IndexResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type IndexesQuery ΒΆ added in v0.20.0
func (IndexesQuery) MarshalEasyJSON ΒΆ added in v0.20.0
func (v IndexesQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexesQuery) MarshalJSON ΒΆ added in v0.20.0
func (v IndexesQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexesQuery) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *IndexesQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexesQuery) UnmarshalJSON ΒΆ added in v0.20.0
func (v *IndexesQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type IndexesResults ΒΆ added in v0.20.0
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 ΒΆ added in v0.20.0
func (v IndexesResults) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IndexesResults) MarshalJSON ΒΆ added in v0.20.0
func (v IndexesResults) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IndexesResults) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *IndexesResults) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IndexesResults) UnmarshalJSON ΒΆ added in v0.20.0
func (v *IndexesResults) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Key ΒΆ added in v0.18.0
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 ΒΆ added in v0.18.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Key) MarshalJSON ΒΆ added in v0.18.0
MarshalJSON supports json.Marshaler interface
func (*Key) UnmarshalEasyJSON ΒΆ added in v0.18.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Key) UnmarshalJSON ΒΆ added in v0.18.0
UnmarshalJSON supports json.Unmarshaler interface
type KeyParsed ΒΆ added in v0.18.0
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 ΒΆ added in v0.18.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeyParsed) MarshalJSON ΒΆ added in v0.18.0
MarshalJSON supports json.Marshaler interface
func (*KeyParsed) UnmarshalEasyJSON ΒΆ added in v0.18.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeyParsed) UnmarshalJSON ΒΆ added in v0.18.0
UnmarshalJSON supports json.Unmarshaler interface
type KeyUpdate ΒΆ added in v0.20.0
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 ΒΆ added in v0.20.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeyUpdate) MarshalJSON ΒΆ added in v0.20.0
MarshalJSON supports json.Marshaler interface
func (*KeyUpdate) UnmarshalEasyJSON ΒΆ added in v0.20.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeyUpdate) UnmarshalJSON ΒΆ added in v0.20.0
UnmarshalJSON supports json.Unmarshaler interface
type KeysQuery ΒΆ added in v0.20.0
func (KeysQuery) MarshalEasyJSON ΒΆ added in v0.20.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeysQuery) MarshalJSON ΒΆ added in v0.20.0
MarshalJSON supports json.Marshaler interface
func (*KeysQuery) UnmarshalEasyJSON ΒΆ added in v0.20.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeysQuery) UnmarshalJSON ΒΆ added in v0.20.0
UnmarshalJSON supports json.Unmarshaler interface
type KeysResults ΒΆ added in v0.20.0
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 ΒΆ added in v0.20.0
func (v KeysResults) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (KeysResults) MarshalJSON ΒΆ added in v0.20.0
func (v KeysResults) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*KeysResults) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *KeysResults) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KeysResults) UnmarshalJSON ΒΆ added in v0.20.0
func (v *KeysResults) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LocalizedAttributes ΒΆ added in v0.29.0
type LocalizedAttributes struct {
Locales []string `json:"locales,omitempty"`
AttributePatterns []string `json:"attributePatterns,omitempty"`
}
func (LocalizedAttributes) MarshalEasyJSON ΒΆ added in v0.29.0
func (v LocalizedAttributes) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LocalizedAttributes) MarshalJSON ΒΆ added in v0.29.0
func (v LocalizedAttributes) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LocalizedAttributes) UnmarshalEasyJSON ΒΆ added in v0.29.0
func (v *LocalizedAttributes) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LocalizedAttributes) UnmarshalJSON ΒΆ added in v0.29.0
func (v *LocalizedAttributes) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MatchingStrategy ΒΆ added in v0.28.0
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 ΒΆ added in v0.19.1
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 ΒΆ added in v0.19.1
func (v MinWordSizeForTypos) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MinWordSizeForTypos) MarshalJSON ΒΆ added in v0.19.1
func (v MinWordSizeForTypos) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MinWordSizeForTypos) UnmarshalEasyJSON ΒΆ added in v0.19.1
func (v *MinWordSizeForTypos) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MinWordSizeForTypos) UnmarshalJSON ΒΆ added in v0.19.1
func (v *MinWordSizeForTypos) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSearchFederation ΒΆ added in v0.29.0
type MultiSearchFederation struct {
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
}
func (MultiSearchFederation) MarshalEasyJSON ΒΆ added in v0.29.0
func (v MultiSearchFederation) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSearchFederation) MarshalJSON ΒΆ added in v0.29.0
func (v MultiSearchFederation) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSearchFederation) UnmarshalEasyJSON ΒΆ added in v0.29.0
func (v *MultiSearchFederation) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSearchFederation) UnmarshalJSON ΒΆ added in v0.29.0
func (v *MultiSearchFederation) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSearchRequest ΒΆ added in v0.24.0
type MultiSearchRequest struct {
Federation *MultiSearchFederation `json:"federation,omitempty"`
Queries []*SearchRequest `json:"queries"`
}
func (MultiSearchRequest) MarshalEasyJSON ΒΆ added in v0.24.0
func (v MultiSearchRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSearchRequest) MarshalJSON ΒΆ added in v0.24.0
func (v MultiSearchRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSearchRequest) UnmarshalEasyJSON ΒΆ added in v0.24.0
func (v *MultiSearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSearchRequest) UnmarshalJSON ΒΆ added in v0.24.0
func (v *MultiSearchRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSearchResponse ΒΆ added in v0.24.0
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 ΒΆ added in v0.24.0
func (v MultiSearchResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSearchResponse) MarshalJSON ΒΆ added in v0.24.0
func (v MultiSearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSearchResponse) UnmarshalEasyJSON ΒΆ added in v0.24.0
func (v *MultiSearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSearchResponse) UnmarshalJSON ΒΆ added in v0.24.0
func (v *MultiSearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Option ΒΆ added in v0.28.0
type Option func(*meiliOpt)
func DisableRetries ΒΆ added in v0.29.0
func DisableRetries() Option
DisableRetries disable retry logic in client
func WithAPIKey ΒΆ added in v0.28.0
WithAPIKey is API key or master key.
func WithContentEncoding ΒΆ added in v0.29.0
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 ΒΆ added in v0.28.0
WithCustomClient set custom http.Client
func WithCustomClientWithTLS ΒΆ added in v0.28.0
WithCustomClientWithTLS client support tls configuration
func WithCustomRetries ΒΆ added in v0.29.0
WithCustomRetries set retry on specific http error code and max retries (min: 1, max: 255)
type Pagination ΒΆ added in v0.20.1
type Pagination struct {
MaxTotalHits int64 `json:"maxTotalHits"`
}
Pagination is the type that represents the pagination setting in meilisearch
func (Pagination) MarshalEasyJSON ΒΆ added in v0.20.1
func (v Pagination) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Pagination) MarshalJSON ΒΆ added in v0.20.1
func (v Pagination) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Pagination) UnmarshalEasyJSON ΒΆ added in v0.20.1
func (v *Pagination) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Pagination) UnmarshalJSON ΒΆ added in v0.20.1
func (v *Pagination) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ProximityPrecisionType ΒΆ added in v0.28.0
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 ΒΆ added in v0.13.1
type RawType []byte
RawType is an alias for raw byte[]
func (RawType) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*RawType) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
type SearchFederationOptions ΒΆ added in v0.29.0
type SearchFederationOptions struct {
Weight float64 `json:"weight"`
}
func (SearchFederationOptions) MarshalEasyJSON ΒΆ added in v0.29.0
func (v SearchFederationOptions) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchFederationOptions) MarshalJSON ΒΆ added in v0.29.0
func (v SearchFederationOptions) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchFederationOptions) UnmarshalEasyJSON ΒΆ added in v0.29.0
func (v *SearchFederationOptions) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchFederationOptions) UnmarshalJSON ΒΆ added in v0.29.0
func (v *SearchFederationOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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 ΒΆ added in v0.13.1
func (v SearchRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchRequest) MarshalJSON ΒΆ added in v0.13.1
func (v SearchRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchRequest) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *SearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchRequest) UnmarshalJSON ΒΆ added in v0.13.1
func (v *SearchRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SearchRequestHybrid ΒΆ added in v0.26.3
type SearchRequestHybrid struct {
SemanticRatio float64 `json:"semanticRatio,omitempty"`
Embedder string `json:"embedder"`
}
func (SearchRequestHybrid) MarshalEasyJSON ΒΆ added in v0.26.3
func (v SearchRequestHybrid) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchRequestHybrid) MarshalJSON ΒΆ added in v0.26.3
func (v SearchRequestHybrid) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchRequestHybrid) UnmarshalEasyJSON ΒΆ added in v0.26.3
func (v *SearchRequestHybrid) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchRequestHybrid) UnmarshalJSON ΒΆ added in v0.26.3
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 ΒΆ added in v0.13.1
func (v SearchResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchResponse) MarshalJSON ΒΆ added in v0.13.1
func (v SearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchResponse) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *SearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchResponse) UnmarshalJSON ΒΆ added in v0.13.1
func (v *SearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ServiceManager ΒΆ added in v0.28.0
type ServiceManager 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)
// 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)
// 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)
// 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)
// 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)
// 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)
// GetTask fetches the details of a specific task.
GetTask(taskUID int64) (*Task, error)
// GetTaskWithContext fetches the details of a specific task with a context for cancellation.
GetTaskWithContext(ctx context.Context, taskUID int64) (*Task, error)
// GetTasks lists all tasks.
GetTasks(param *TasksQuery) (*TaskResult, error)
// GetTasksWithContext lists all tasks with a context for cancellation.
GetTasksWithContext(ctx context.Context, param *TasksQuery) (*TaskResult, error)
// 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)
// WaitForTask waits for a specific task to complete.
WaitForTask(taskUID int64, interval time.Duration) (*Task, error)
// WaitForTaskWithContext waits for a specific task to complete with a context for cancellation.
WaitForTaskWithContext(ctx context.Context, taskUID int64, interval time.Duration) (*Task, 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)
// GetStats fetches global stats.
GetStats() (*Stats, error)
// GetStatsWithContext fetches global stats with a context for cancellation.
GetStatsWithContext(ctx context.Context) (*Stats, 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)
// 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
// 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 ΒΆ added in v0.28.0
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)
func New ΒΆ added in v0.28.0
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)
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 ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Settings) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Settings) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Settings) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
type SimilarDocumentQuery ΒΆ added in v0.27.2
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 ΒΆ added in v0.27.2
func (v SimilarDocumentQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SimilarDocumentQuery) MarshalJSON ΒΆ added in v0.27.2
func (v SimilarDocumentQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SimilarDocumentQuery) UnmarshalEasyJSON ΒΆ added in v0.27.2
func (v *SimilarDocumentQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SimilarDocumentQuery) UnmarshalJSON ΒΆ added in v0.27.2
func (v *SimilarDocumentQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SimilarDocumentResult ΒΆ added in v0.27.2
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 ΒΆ added in v0.27.2
func (v SimilarDocumentResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SimilarDocumentResult) MarshalJSON ΒΆ added in v0.27.2
func (v SimilarDocumentResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SimilarDocumentResult) UnmarshalEasyJSON ΒΆ added in v0.27.2
func (v *SimilarDocumentResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SimilarDocumentResult) UnmarshalJSON ΒΆ added in v0.27.2
func (v *SimilarDocumentResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SortFacetType ΒΆ added in v0.28.0
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 ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Stats) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Stats) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Stats) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface
type StatsIndex ΒΆ added in v0.9.1
type StatsIndex struct {
NumberOfDocuments int64 `json:"numberOfDocuments"`
IsIndexing bool `json:"isIndexing"`
FieldDistribution map[string]int64 `json:"fieldDistribution"`
}
StatsIndex is the type that represent the stats of an index in meilisearch
func (StatsIndex) MarshalEasyJSON ΒΆ added in v0.13.1
func (v StatsIndex) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StatsIndex) MarshalJSON ΒΆ added in v0.13.1
func (v StatsIndex) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StatsIndex) UnmarshalEasyJSON ΒΆ added in v0.13.1
func (v *StatsIndex) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StatsIndex) UnmarshalJSON ΒΆ added in v0.13.1
func (v *StatsIndex) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SwapIndexesParams ΒΆ added in v0.22.0
type SwapIndexesParams struct {
Indexes []string `json:"indexes"`
}
func (SwapIndexesParams) MarshalEasyJSON ΒΆ added in v0.22.0
func (v SwapIndexesParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SwapIndexesParams) MarshalJSON ΒΆ added in v0.22.0
func (v SwapIndexesParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SwapIndexesParams) UnmarshalEasyJSON ΒΆ added in v0.22.0
func (v *SwapIndexesParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SwapIndexesParams) UnmarshalJSON ΒΆ added in v0.22.0
func (v *SwapIndexesParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Task ΒΆ added in v0.18.0
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 ΒΆ added in v0.18.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Task) MarshalJSON ΒΆ added in v0.18.0
MarshalJSON supports json.Marshaler interface
func (*Task) UnmarshalEasyJSON ΒΆ added in v0.18.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Task) UnmarshalJSON ΒΆ added in v0.18.0
UnmarshalJSON supports json.Unmarshaler interface
type TaskInfo ΒΆ added in v0.20.0
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 ΒΆ added in v0.20.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (TaskInfo) MarshalJSON ΒΆ added in v0.20.0
MarshalJSON supports json.Marshaler interface
func (*TaskInfo) UnmarshalEasyJSON ΒΆ added in v0.20.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TaskInfo) UnmarshalJSON ΒΆ added in v0.20.0
UnmarshalJSON supports json.Unmarshaler interface
type TaskResult ΒΆ added in v0.20.0
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 ΒΆ added in v0.20.0
func (v TaskResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TaskResult) MarshalJSON ΒΆ added in v0.20.0
func (v TaskResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TaskResult) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *TaskResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TaskResult) UnmarshalJSON ΒΆ added in v0.20.0
func (v *TaskResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TaskStatus ΒΆ added in v0.18.0
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 ΒΆ added in v0.26.0
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 ΒΆ added in v0.20.0
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
}
TasksQuery is a list of filter available to send as query parameters
func (TasksQuery) MarshalEasyJSON ΒΆ added in v0.20.0
func (v TasksQuery) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TasksQuery) MarshalJSON ΒΆ added in v0.20.0
func (v TasksQuery) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TasksQuery) UnmarshalEasyJSON ΒΆ added in v0.20.0
func (v *TasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TasksQuery) UnmarshalJSON ΒΆ added in v0.20.0
func (v *TasksQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TenantTokenClaims ΒΆ added in v0.19.0
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 ΒΆ added in v0.19.0
func (v TenantTokenClaims) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TenantTokenClaims) MarshalJSON ΒΆ added in v0.19.0
func (v TenantTokenClaims) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TenantTokenClaims) UnmarshalEasyJSON ΒΆ added in v0.19.0
func (v *TenantTokenClaims) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TenantTokenClaims) UnmarshalJSON ΒΆ added in v0.19.0
func (v *TenantTokenClaims) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TenantTokenOptions ΒΆ added in v0.19.0
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 ΒΆ added in v0.19.0
func (v TenantTokenOptions) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TenantTokenOptions) MarshalJSON ΒΆ added in v0.19.0
func (v TenantTokenOptions) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TenantTokenOptions) UnmarshalEasyJSON ΒΆ added in v0.19.0
func (v *TenantTokenOptions) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TenantTokenOptions) UnmarshalJSON ΒΆ added in v0.19.0
func (v *TenantTokenOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TypoTolerance ΒΆ added in v0.19.1
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 ΒΆ added in v0.19.1
func (v TypoTolerance) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TypoTolerance) MarshalJSON ΒΆ added in v0.19.1
func (v TypoTolerance) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TypoTolerance) UnmarshalEasyJSON ΒΆ added in v0.19.1
func (v *TypoTolerance) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TypoTolerance) UnmarshalJSON ΒΆ added in v0.19.1
func (v *TypoTolerance) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UpdateIndexRequest ΒΆ added in v0.15.0
type UpdateIndexRequest struct {
PrimaryKey string `json:"primaryKey"`
}
UpdateIndexRequest is the request body for update Index primary key
func (UpdateIndexRequest) MarshalEasyJSON ΒΆ added in v0.15.0
func (v UpdateIndexRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UpdateIndexRequest) MarshalJSON ΒΆ added in v0.15.0
func (v UpdateIndexRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UpdateIndexRequest) UnmarshalEasyJSON ΒΆ added in v0.15.0
func (v *UpdateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdateIndexRequest) UnmarshalJSON ΒΆ added in v0.15.0
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 ΒΆ added in v0.13.1
MarshalEasyJSON supports easyjson.Marshaler interface
func (Version) MarshalJSON ΒΆ added in v0.13.1
MarshalJSON supports json.Marshaler interface
func (*Version) UnmarshalEasyJSON ΒΆ added in v0.13.1
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Version) UnmarshalJSON ΒΆ added in v0.13.1
UnmarshalJSON supports json.Unmarshaler interface