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(context.Background(), documents, nil)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(task.TaskUID)
Index ΒΆ
- Constants
- Variables
- func BoolPtr(v bool) *bool
- func FloatPtr(v float64) *float64
- func GetQualifiedVersion() (qualifiedVersion string)
- func Int64Ptr(v int64) *int64
- func IntPtr(v int) *int
- func IsValidUUID(uuid string) bool
- func RegisterDecoder(contentType string, decoder func(io.ReadCloser) Decoder)
- func StringPtr(v string) *string
- func TimePtr(v time.Time) *time.Time
- func VersionErrorHintMessage(err error, req *internalRequest) error
- type APIErrCode
- type APIErrorDetails
- type Action
- type ActionDef
- type Actions
- type AddWebhookRequest
- type AttributeFeatures
- type AttributeRule
- type Batch
- type BatchProgress
- type BatchProgressStep
- type BatchStats
- type BatchStatsInternalDatabaseSize
- type BatchStatsWriteChannelCongestion
- type BatchesQuery
- type BatchesResults
- type CancelTasksQuery
- type Chat
- type ChatCompletionChoice
- type ChatCompletionChoiceDelta
- type ChatCompletionMessage
- type ChatCompletionQuery
- type ChatCompletionStreamChunk
- type ChatManager
- type ChatReader
- type ChatRole
- type ChatSource
- type ChatWorkspace
- type ChatWorkspaceSettings
- type ChatWorkspaceSettingsPrompts
- type Conditions
- type ContentEncoding
- type CreateIndexRequest
- type CsvDocumentsQuery
- type Decoder
- type DeleteTasksQuery
- type Details
- type Distribution
- type DocumentManager
- type DocumentOptions
- type DocumentQuery
- type DocumentReader
- type DocumentsQuery
- type DocumentsResult
- type Embedder
- type EmbedderPooling
- type EmbedderSource
- type EncodingCompressionLevel
- type ErrCode
- type Error
- type Event
- type ExperimentalFeatures
- func (ef *ExperimentalFeatures) Get(ctx context.Context) (*ExperimentalFeaturesResult, error)
- func (ef *ExperimentalFeatures) SetChatCompletions(enable bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetCompositeEmbedders(enable bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetContainsFilter(containsFilter bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetDynamicSearchRules(dynamicSearchRule bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetEditDocumentsByFunction(editDocumentsByFunction bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetForeignKeys(enable bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetGetTaskDocumentsRoute(enable bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetLogsRoute(logsRoute bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetMetrics(metrics bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetMultiModal(enable bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetNetwork(enable bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) SetRenderRoute(renderRoot bool) *ExperimentalFeatures
- func (ef *ExperimentalFeatures) Update(ctx context.Context) (*ExperimentalFeaturesResult, error)
- type ExperimentalFeaturesBase
- type ExperimentalFeaturesResult
- type ExportParams
- type FacetSearchRequest
- type FacetSearchResponse
- type Faceting
- type FilterCondition
- type FilterFeatures
- type ForeignKey
- type Fragment
- type Health
- type Hit
- type Hits
- type ImportFrom
- type IndexConfig
- type IndexExportOptions
- type IndexManager
- type IndexReader
- type IndexResult
- type IndexesQuery
- type IndexesResults
- type InputKind
- type JSONMarshal
- type JSONUnmarshal
- type Key
- type KeyManager
- type KeyParsed
- type KeyReader
- type KeyUpdate
- type KeysQuery
- type KeysResults
- type ListChatWorkSpaceQuery
- type ListChatWorkspace
- type LocalizedAttributes
- type MatchingStrategy
- type MinWordSizeForTypos
- type MultiSearchFederation
- type MultiSearchFederationMergeFacets
- type MultiSearchRequest
- type MultiSearchResponse
- type Network
- type Opt
- 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 WithCustomDialContext(dial func(ctx context.Context, network, addr string) (net.Conn, error)) Option
- func WithCustomExpectContinueTimeout(timeout time.Duration) Option
- func WithCustomIdleConnTimeout(timeout time.Duration) Option
- func WithCustomJsonMarshaler(marshal JSONMarshal) Option
- func WithCustomJsonUnmarshaler(unmarshal JSONUnmarshal) Option
- func WithCustomMaxIdleConns(maxIdleConns int) Option
- func WithCustomMaxIdleConnsPerHost(maxIdleConnsPerHost int) Option
- func WithCustomProxy(proxy func(*http.Request) (*url.URL, error)) Option
- func WithCustomRetries(retryOnStatus []int, maxRetries uint8) Option
- func WithCustomTLSHandshakeTimeout(timeout time.Duration) Option
- type Origin
- type Pagination
- type Pin
- type ProximityPrecisionType
- type QueryCondition
- type Remote
- type RemoteError
- type RemoteStatus
- type RenderTemplateParams
- type RenderTemplateResponse
- type Scale
- type SearchFederationOptions
- type SearchMetadata
- type SearchParameters
- type SearchReader
- type SearchRequest
- type SearchRequestBuilder
- func (b *SearchRequestBuilder) Build() *SearchRequest
- func (b *SearchRequestBuilder) WithAttributesToCrop(attrs ...string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithAttributesToHighlight(attrs ...string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithAttributesToRetrieve(attrs ...string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithAttributesToSearchOn(attrs ...string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithCropLength(v int64) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithCropMarker(v string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithDistinct(v string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithFacets(facets ...string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithFederationOptions(o *SearchFederationOptions) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithFilter(v interface{}) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithHighlightPostTag(v string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithHighlightPreTag(v string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithHitsPerPage(v int64) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithHybrid(h *SearchRequestHybrid) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithIndexUID(v string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithInlineRule(r *SearchRequestInlineRule) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithLimit(v int64) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithLocales(locales ...string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithMatchingStrategy(v MatchingStrategy) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithMedia(m map[string]any) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithOffset(v int64) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithPage(v int64) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithPersonalize(p *SearchRequestPersonalize) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithQuery(v string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithRankingScoreThreshold(v float64) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithRetrieveVectors(v bool) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithShowMatchesPosition(v bool) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithShowPerformanceDetails(v bool) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithShowRankingScore(v bool) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithShowRankingScoreDetails(v bool) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithSort(sort ...string) *SearchRequestBuilder
- func (b *SearchRequestBuilder) WithVector(v []float32) *SearchRequestBuilder
- type SearchRequestHybrid
- type SearchRequestInlineRule
- type SearchRequestPersonalize
- type SearchResponse
- type SearchRule
- type SearchRulesFilter
- type SearchRulesManager
- type SearchRulesParams
- type SearchRulesReader
- type SearchRulesRequest
- type SearchRulesResults
- type Selector
- type ServiceManager
- type ServiceReader
- type Settings
- type SettingsManager
- type SettingsReader
- type Shard
- type SimilarDocumentQuery
- type SimilarDocumentResult
- type SortFacetType
- type Stats
- type StatsIndex
- type StatsParams
- type Stream
- type SwapIndexesParams
- type Task
- type TaskInfo
- type TaskManager
- type TaskNetwork
- type TaskReader
- type TaskRemote
- type TaskResult
- type TaskStatus
- type TaskType
- type TasksQuery
- type TempelateInput
- type Template
- type TemplateKind
- type TenantTokenClaims
- type TenantTokenOptions
- type TimeCondition
- type Timestampz
- type TypoTolerance
- type UpdateDocumentByFunctionRequest
- type UpdateIndexRequestParams
- type UpdateNetworkRequest
- type UpdateRemote
- type UpdateRemoteShard
- type UpdateWebhookRequest
- type Version
- type Webhook
- type WebhookManager
- type WebhookReader
- type WebhookResults
Examples ΒΆ
Constants ΒΆ
const ( 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.37.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") ErrMeilisearchNotAvailable = errors.New("meilisearch service is not available") )
General errors
Functions ΒΆ
func GetQualifiedVersion ΒΆ added in v0.19.1
func GetQualifiedVersion() (qualifiedVersion string)
func IsValidUUID ΒΆ added in v0.20.0
func RegisterDecoder ΒΆ added in v0.33.1
func RegisterDecoder(contentType string, decoder func(io.ReadCloser) Decoder)
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 APIErrCode ΒΆ added in v0.37.0
type APIErrCode string
APIErrCode represents Meilisearch API error codes returned by the Meilisearch server.
const ( // APIErrCodeAPIKeyAlreadyExists A key with this uid already exists. APIErrCodeAPIKeyAlreadyExists APIErrCode = "api_key_already_exists" // APIErrCodeAPIKeyNotFound The requested API key could not be found. APIErrCodeAPIKeyNotFound APIErrCode = "api_key_not_found" // APIErrCodeBadRequest The request is invalid, check the error message for more information. APIErrCodeBadRequest APIErrCode = "bad_request" // APIErrCodeBatchNotFound The requested batch does not exist. Please ensure that you are using the correct uid. APIErrCodeBatchNotFound APIErrCode = "batch_not_found" // APIErrCodeDatabaseSizeLimitReached The requested database has reached its maximum size. APIErrCodeDatabaseSizeLimitReached APIErrCode = "database_size_limit_reached" // APIErrCodeDocumentFieldsLimitReached A document exceeds the maximum limit of 65,536 attributes. APIErrCodeDocumentFieldsLimitReached APIErrCode = "document_fields_limit_reached" // APIErrCodeDocumentNotFound The requested document can't be retrieved. Either it doesn't exist, or the database was left in an inconsistent state. APIErrCodeDocumentNotFound APIErrCode = "document_not_found" // APIErrCodeDumpProcessFailed An error occurred during the dump creation process. The task was aborted. APIErrCodeDumpProcessFailed APIErrCode = "dump_process_failed" // APIErrCodeFacetSearchDisabled The /facet-search route has been queried while the facetSearch index setting is set to false. APIErrCodeFacetSearchDisabled APIErrCode = "facet_search_disabled" // APIErrCodeFeatureNotEnabled You have tried using an experimental feature without activating it. APIErrCodeFeatureNotEnabled APIErrCode = "feature_not_enabled" // APIErrCodeImmutableAPIKeyActions The actions field of an API key cannot be modified. APIErrCodeImmutableAPIKeyActions APIErrCode = "immutable_api_key_actions" // APIErrCodeImmutableAPIKeyCreatedAt The createdAt field of an API key cannot be modified. APIErrCodeImmutableAPIKeyCreatedAt APIErrCode = "immutable_api_key_created_at" // APIErrCodeImmutableAPIKeyExpiresAt The expiresAt field of an API key cannot be modified. APIErrCodeImmutableAPIKeyExpiresAt APIErrCode = "immutable_api_key_expires_at" // APIErrCodeImmutableAPIKeyIndexes The indexes field of an API key cannot be modified. APIErrCodeImmutableAPIKeyIndexes APIErrCode = "immutable_api_key_indexes" // APIErrCodeImmutableAPIKeyKey The key field of an API key cannot be modified. APIErrCodeImmutableAPIKeyKey APIErrCode = "immutable_api_key_key" // APIErrCodeImmutableAPIKeyUID The uid field of an API key cannot be modified. APIErrCodeImmutableAPIKeyUID APIErrCode = "immutable_api_key_uid" // APIErrCodeImmutableAPIKeyUpdatedAt The updatedAt field of an API key cannot be modified. APIErrCodeImmutableAPIKeyUpdatedAt APIErrCode = "immutable_api_key_updated_at" // APIErrCodeImmutableIndexUID The uid field of an index cannot be modified. APIErrCodeImmutableIndexUID APIErrCode = "immutable_index_uid" // APIErrCodeImmutableIndexUpdatedAt The updatedAt field of an index cannot be modified. APIErrCodeImmutableIndexUpdatedAt APIErrCode = "immutable_index_updated_at" // APIErrCodeImmutableWebhook You tried to modify a reserved webhook. Reserved webhooks are configured by Meilisearch Cloud and have isEditable set to false. Webhooks created with an instance option are also immutable. APIErrCodeImmutableWebhook APIErrCode = "immutable_webhook" // APIErrCodeImmutableWebhookUUID You tried to manually set a webhook uuid. Meilisearch automatically generates uuid for webhooks. APIErrCodeImmutableWebhookUUID APIErrCode = "immutable_webhook_uuid" // APIErrCodeImmutableWebhookIsEditable You tried to manually set a webhook's isEditable field. Meilisearch automatically sets isEditable for all webhooks. Only reserved webhooks have isEditable set to false. APIErrCodeImmutableWebhookIsEditable APIErrCode = "immutable_webhook_is_editable" // APIErrCodeIndexAlreadyExists An index with this uid already exists, check out our guide on index creation. APIErrCodeIndexAlreadyExists APIErrCode = "index_already_exists" // APIErrCodeIndexCreationFailed An error occurred while trying to create an index, check out our guide on index creation. APIErrCodeIndexCreationFailed APIErrCode = "index_creation_failed" // APIErrCodeIndexNotFound An index with this uid was not found, check out our guide on index creation. APIErrCodeIndexNotFound APIErrCode = "index_not_found" // APIErrCodeIndexPrimaryKeyAlreadyExists The requested index already has a primary key that cannot be changed. APIErrCodeIndexPrimaryKeyAlreadyExists APIErrCode = "index_primary_key_already_exists" // APIErrCodeIndexPrimaryKeyMultipleCandidatesFound Primary key inference failed because the received documents contain multiple fields ending with id. Use the update index endpoint to manually set a primary key. APIErrCodeIndexPrimaryKeyMultipleCandidatesFound APIErrCode = "index_primary_key_multiple_candidates_found" // APIErrCodeInternal Meilisearch experienced an internal error. Check the error message, and open an issue if necessary. APIErrCodeInternal APIErrCode = "internal" // APIErrCodeInvalidAPIKey The requested resources are protected with an API key. The provided API key is invalid. Read more about it in our security tutorial. APIErrCodeInvalidAPIKey APIErrCode = "invalid_api_key" // APIErrCodeInvalidAPIKeyActions The actions field for the provided API key resource is invalid. It should be an array of strings representing action names. APIErrCodeInvalidAPIKeyActions APIErrCode = "invalid_api_key_actions" // APIErrCodeInvalidAPIKeyDescription The description field for the provided API key resource is invalid. It should either be a string or set to null. APIErrCodeInvalidAPIKeyDescription APIErrCode = "invalid_api_key_description" // APIErrCodeInvalidAPIKeyExpiresAt The expiresAt field for the provided API key resource is invalid. It should either show a future date or datetime in the RFC 3339 format or be set to null. APIErrCodeInvalidAPIKeyExpiresAt APIErrCode = "invalid_api_key_expires_at" // APIErrCodeInvalidAPIKeyIndexes The indexes field for the provided API key resource is invalid. It should be an array of strings representing index names. APIErrCodeInvalidAPIKeyIndexes APIErrCode = "invalid_api_key_indexes" // APIErrCodeInvalidAPIKeyLimit The limit parameter is invalid. It should be an integer. APIErrCodeInvalidAPIKeyLimit APIErrCode = "invalid_api_key_limit" // APIErrCodeInvalidAPIKeyName The given name is invalid. It should either be a string or set to null. APIErrCodeInvalidAPIKeyName APIErrCode = "invalid_api_key_name" // APIErrCodeInvalidAPIKeyOffset The offset parameter is invalid. It should be an integer. APIErrCodeInvalidAPIKeyOffset APIErrCode = "invalid_api_key_offset" // APIErrCodeInvalidAPIKeyUID The given uid is invalid. The uid must follow the uuid v4 format. APIErrCodeInvalidAPIKeyUID APIErrCode = "invalid_api_key_uid" // APIErrCodeInvalidSearchAttributesToSearchOn The value passed to attributesToSearchOn is invalid. attributesToSearchOn accepts an array of strings indicating document attributes. Attributes given to attributesToSearchOn must be present in the searchableAttributes list. APIErrCodeInvalidSearchAttributesToSearchOn APIErrCode = "invalid_search_attributes_to_search_on" // APIErrCodeInvalidSearchMedia The value passed to media is not a valid JSON object. APIErrCodeInvalidSearchMedia APIErrCode = "invalid_search_media" // APIErrCodeInvalidSearchMediaAndVector The search query contains non-null values for both media and vector. These two parameters are mutually exclusive, since media generates vector embeddings via the embedder configured in hybrid. APIErrCodeInvalidSearchMediaAndVector APIErrCode = "invalid_search_media_and_vector" // APIErrCodeInvalidFilter The provided filter expression is invalid. This may happen if the filter syntax is malformed, uses an unsupported operator, or references an attribute not listed in filterableAttributes. APIErrCodeInvalidFilter APIErrCode = "invalid_filter" // APIErrCodeInvalidContentType The Content-Type header is not supported by Meilisearch. Currently, Meilisearch only supports JSON, CSV, and NDJSON. APIErrCodeInvalidContentType APIErrCode = "invalid_content_type" // APIErrCodeInvalidDocumentCSVDelimiter The csvDelimiter parameter is invalid. It should either be a string or a single ASCII character. APIErrCodeInvalidDocumentCSVDelimiter APIErrCode = "invalid_document_csv_delimiter" // APIErrCodeInvalidDocumentID The provided document identifier does not meet the format requirements. A document identifier must be of type integer or string, composed only of alphanumeric characters (a-z A-Z 0-9), hyphens (-), and underscores (_). APIErrCodeInvalidDocumentID APIErrCode = "invalid_document_id" // APIErrCodeInvalidDocumentFields The fields parameter is invalid. It should be a string. APIErrCodeInvalidDocumentFields APIErrCode = "invalid_document_fields" // APIErrCodeInvalidDocumentFilter The filter parameter is invalid or the attribute used for filtering is not filterable. APIErrCodeInvalidDocumentFilter APIErrCode = "invalid_document_filter" // APIErrCodeInvalidDocumentLimit The limit parameter is invalid. It should be an integer. APIErrCodeInvalidDocumentLimit APIErrCode = "invalid_document_limit" // APIErrCodeInvalidDocumentOffset The offset parameter is invalid. It should be an integer. APIErrCodeInvalidDocumentOffset APIErrCode = "invalid_document_offset" // APIErrCodeInvalidDocumentSort The sort parameter is invalid or the attribute used for sorting is not sortable. APIErrCodeInvalidDocumentSort APIErrCode = "invalid_document_sort" // APIErrCodeInvalidDocumentGeoField The provided _geo field of one or more documents is invalid. Meilisearch expects _geo to be an object with lat and lng fields. APIErrCodeInvalidDocumentGeoField APIErrCode = "invalid_document_geo_field" // APIErrCodeInvalidDocumentGeoJSONField The geojson field in one or more documents is invalid or doesn't match the GeoJSON specification. APIErrCodeInvalidDocumentGeoJSONField APIErrCode = "invalid_document_geojson_field" // APIErrCodeInvalidExportURL The export target instance URL is invalid or could not be reached. APIErrCodeInvalidExportURL APIErrCode = "invalid_export_url" // APIErrCodeInvalidExportAPIKey The supplied security key does not have the required permissions to access the target instance. APIErrCodeInvalidExportAPIKey APIErrCode = "invalid_export_api_key" // APIErrCodeInvalidExportPayloadSize The provided payload size is invalid. The payload size must be a string indicating the maximum payload size in a human-readable format. APIErrCodeInvalidExportPayloadSize APIErrCode = "invalid_export_payload_size" // APIErrCodeInvalidExportIndexesPatterns The provided index pattern is invalid. The index pattern must be an alphanumeric string, optionally including a wildcard. APIErrCodeInvalidExportIndexesPatterns APIErrCode = "invalid_export_indexes_patterns" // APIErrCodeInvalidExportIndexFilter The provided index export filter is not a valid filter expression. APIErrCodeInvalidExportIndexFilter APIErrCode = "invalid_export_index_filter" // APIErrCodeInvalidFacetSearchFacetName The attribute used for the facetName field is either not a string or not defined in the filterableAttributes list. APIErrCodeInvalidFacetSearchFacetName APIErrCode = "invalid_facet_search_facet_name" // APIErrCodeInvalidFacetSearchFacetQuery The provided value for facetQuery is invalid. It should either be a string or null. APIErrCodeInvalidFacetSearchFacetQuery APIErrCode = "invalid_facet_search_facet_query" // APIErrCodeInvalidIndexLimit The limit parameter is invalid. It should be an integer. APIErrCodeInvalidIndexLimit APIErrCode = "invalid_index_limit" // APIErrCodeInvalidIndexOffset The offset parameter is invalid. It should be an integer. APIErrCodeInvalidIndexOffset APIErrCode = "invalid_index_offset" // APIErrCodeInvalidIndexUID There is an error in the provided index format, check out our guide on index creation. APIErrCodeInvalidIndexUID APIErrCode = "invalid_index_uid" // APIErrCodeInvalidIndexPrimaryKey The primaryKey field is invalid. It should either be a string or set to null. APIErrCodeInvalidIndexPrimaryKey APIErrCode = "invalid_index_primary_key" // APIErrCodeInvalidMultiSearchQueryFederated A multi-search query includes federationOptions but the top-level federation object is null or missing. APIErrCodeInvalidMultiSearchQueryFederated APIErrCode = "invalid_multi_search_query_federated" // APIErrCodeInvalidMultiSearchQueryPagination A multi-search query contains page, hitsPerPage, limit or offset, but the top-level federation object is not null. APIErrCodeInvalidMultiSearchQueryPagination APIErrCode = "invalid_multi_search_query_pagination" // APIErrCodeInvalidMultiSearchQueryPosition federationOptions.queryPosition is not a positive integer. APIErrCodeInvalidMultiSearchQueryPosition APIErrCode = "invalid_multi_search_query_position" // APIErrCodeInvalidMultiSearchWeight A multi-search query contains a negative value for federated.weight. APIErrCodeInvalidMultiSearchWeight APIErrCode = "invalid_multi_search_weight" // APIErrCodeInvalidMultiSearchQueriesRankingRules Two or more queries in a multi-search request have incompatible results. APIErrCodeInvalidMultiSearchQueriesRankingRules APIErrCode = "invalid_multi_search_queries_ranking_rules" // APIErrCodeInvalidMultiSearchFacets federation.facetsByIndex.<INDEX_NAME> contains a value that is not in the filterable attributes list. APIErrCodeInvalidMultiSearchFacets APIErrCode = "invalid_multi_search_facets" // APIErrCodeInvalidMultiSearchSortFacetValuesBy federation.mergeFacets.sortFacetValuesBy is not a string or doesn't have one of the allowed values. APIErrCodeInvalidMultiSearchSortFacetValuesBy APIErrCode = "invalid_multi_search_sort_facet_values_by" // APIErrCodeInvalidMultiSearchQueryFacets A query in the queries array contains facets when federation is present and non-null. APIErrCodeInvalidMultiSearchQueryFacets APIErrCode = "invalid_multi_search_query_facets" // APIErrCodeInvalidMultiSearchMergeFacets federation.mergeFacets is not an object or contains unexpected fields. APIErrCodeInvalidMultiSearchMergeFacets APIErrCode = "invalid_multi_search_merge_facets" // APIErrCodeInvalidMultiSearchMaxValuesPerFacet federation.mergeFacets.maxValuesPerFacet is not a positive integer. APIErrCodeInvalidMultiSearchMaxValuesPerFacet APIErrCode = "invalid_multi_search_max_values_per_facet" // APIErrCodeInvalidMultiSearchFacetOrder Two or more indexes have a different faceting.sortFacetValuesBy for the same requested facet. APIErrCodeInvalidMultiSearchFacetOrder APIErrCode = "invalid_multi_search_facet_order" // APIErrCodeInvalidMultiSearchFacetsByIndex facetsByIndex is not an object or contains unknown fields. APIErrCodeInvalidMultiSearchFacetsByIndex APIErrCode = "invalid_multi_search_facets_by_index" // APIErrCodeInvalidMultiSearchRemote federationOptions.remote is not network.self and is not a key in network.remotes. APIErrCodeInvalidMultiSearchRemote APIErrCode = "invalid_multi_search_remote" // APIErrCodeInvalidNetworkSelf The network object contains a self that is not a string or null. APIErrCodeInvalidNetworkSelf APIErrCode = "invalid_network_self" // APIErrCodeInvalidNetworkRemotes The network object contains a remotes that is not an object or null. APIErrCodeInvalidNetworkRemotes APIErrCode = "invalid_network_remotes" // APIErrCodeInvalidNetworkURL One of the remotes in the network object contains a url that is not a string. APIErrCodeInvalidNetworkURL APIErrCode = "invalid_network_url" // APIErrCodeInvalidNetworkSearchAPIKey One of the remotes in the network object contains a searchAPIKey that is not a string or null. APIErrCodeInvalidNetworkSearchAPIKey APIErrCode = "invalid_network_search_api_key" // APIErrCodeInvalidSearchAttributesToCrop The attributesToCrop parameter is invalid. It should be an array of strings, a string, or set to null. APIErrCodeInvalidSearchAttributesToCrop APIErrCode = "invalid_search_attributes_to_crop" // APIErrCodeInvalidSearchAttributesToHighlight The attributesToHighlight parameter is invalid. It should be an array of strings, a string, or set to null. APIErrCodeInvalidSearchAttributesToHighlight APIErrCode = "invalid_search_attributes_to_highlight" // APIErrCodeInvalidSearchAttributesToRetrieve The attributesToRetrieve parameter is invalid. It should be an array of strings, a string, or set to null. APIErrCodeInvalidSearchAttributesToRetrieve APIErrCode = "invalid_search_attributes_to_retrieve" // APIErrCodeInvalidSearchCropLength The cropLength parameter is invalid. It should be an integer. APIErrCodeInvalidSearchCropLength APIErrCode = "invalid_search_crop_length" // APIErrCodeInvalidSearchCropMarker The cropMarker parameter is invalid. It should be a string or set to null. APIErrCodeInvalidSearchCropMarker APIErrCode = "invalid_search_crop_marker" // APIErrCodeInvalidSearchEmbedder embedder is invalid. It should be a string corresponding to the name of a configured embedder. APIErrCodeInvalidSearchEmbedder APIErrCode = "invalid_search_embedder" // APIErrCodeInvalidSearchFacets The facets parameter is invalid or the attribute used for faceting is not filterable. APIErrCodeInvalidSearchFacets APIErrCode = "invalid_search_facets" // APIErrCodeInvalidSearchFilter The syntax for the filter parameter is invalid or the attribute used for filtering is not filterable. APIErrCodeInvalidSearchFilter APIErrCode = "invalid_search_filter" // APIErrCodeInvalidSearchHighlightPostTag The highlightPostTag parameter is invalid. It should be a string. APIErrCodeInvalidSearchHighlightPostTag APIErrCode = "invalid_search_highlight_post_tag" // APIErrCodeInvalidSearchHighlightPreTag The highlightPreTag parameter is invalid. It should be a string. APIErrCodeInvalidSearchHighlightPreTag APIErrCode = "invalid_search_highlight_pre_tag" // APIErrCodeInvalidSearchHitsPerPage The hitsPerPage parameter is invalid. It should be an integer. APIErrCodeInvalidSearchHitsPerPage APIErrCode = "invalid_search_hits_per_page" // APIErrCodeInvalidSearchHybridQuery The hybrid parameter is neither null nor an object, or it is an object with unknown keys. APIErrCodeInvalidSearchHybridQuery APIErrCode = "invalid_search_hybrid_query" // APIErrCodeInvalidSearchLimit The limit parameter is invalid. It should be an integer. APIErrCodeInvalidSearchLimit APIErrCode = "invalid_search_limit" // APIErrCodeInvalidSearchLocales The locales parameter is invalid. APIErrCodeInvalidSearchLocales APIErrCode = "invalid_search_locales" // APIErrCodeInvalidSettingsEmbedder The embedders index setting value is invalid. APIErrCodeInvalidSettingsEmbedder APIErrCode = "invalid_settings_embedder" // APIErrCodeInvalidSettingsFacetSearch The facetSearch index setting value is invalid. APIErrCodeInvalidSettingsFacetSearch APIErrCode = "invalid_settings_facet_search" // APIErrCodeInvalidSettingsLocalizedAttributes The localizedAttributes index setting value is invalid. APIErrCodeInvalidSettingsLocalizedAttributes APIErrCode = "invalid_settings_localized_attributes" // APIErrCodeInvalidSearchMatchingStrategy The matchingStrategy parameter is invalid. It should either be set to last or all. APIErrCodeInvalidSearchMatchingStrategy APIErrCode = "invalid_search_matching_strategy" // APIErrCodeInvalidSearchOffset The offset parameter is invalid. It should be an integer. APIErrCodeInvalidSearchOffset APIErrCode = "invalid_search_offset" // APIErrCodeInvalidSettingsPrefixSearch The prefixSearch index setting value is invalid. APIErrCodeInvalidSettingsPrefixSearch APIErrCode = "invalid_settings_prefix_search" // APIErrCodeInvalidSearchPage The page parameter is invalid. It should be an integer. APIErrCodeInvalidSearchPage APIErrCode = "invalid_search_page" // APIErrCodeInvalidSearchQ The q parameter is invalid. It should be a string or set to null. APIErrCodeInvalidSearchQ APIErrCode = "invalid_search_q" // APIErrCodeInvalidSearchRankingScoreThreshold The rankingScoreThreshold in a search or multi-search request is not a number between 0.0 and 1.0. APIErrCodeInvalidSearchRankingScoreThreshold APIErrCode = "invalid_search_ranking_score_threshold" // APIErrCodeInvalidSearchShowMatchesPosition The showMatchesPosition parameter is invalid. It should either be a boolean or set to null. APIErrCodeInvalidSearchShowMatchesPosition APIErrCode = "invalid_search_show_matches_position" // APIErrCodeInvalidSearchSort The sort parameter is invalid or the attribute used for sorting is not sortable. APIErrCodeInvalidSearchSort APIErrCode = "invalid_search_sort" // APIErrCodeInvalidSettingsDisplayedAttributes The value of displayed attributes is invalid. It should be an empty array, an array of strings, or set to null. APIErrCodeInvalidSettingsDisplayedAttributes APIErrCode = "invalid_settings_displayed_attributes" // APIErrCodeInvalidSettingsDistinctAttribute The value of distinct attributes is invalid. It should be a string or set to null. APIErrCodeInvalidSettingsDistinctAttribute APIErrCode = "invalid_settings_distinct_attribute" // APIErrCodeInvalidSettingsFacetingSortFacetValuesBy The value provided for the sortFacetValuesBy object is incorrect. The accepted values are alpha or count. APIErrCodeInvalidSettingsFacetingSortFacetValuesBy APIErrCode = "invalid_settings_faceting_sort_facet_values_by" // APIErrCodeInvalidSettingsFacetingMaxValuesPerFacet The value for the maxValuesPerFacet field is invalid. It should either be an integer or set to null. APIErrCodeInvalidSettingsFacetingMaxValuesPerFacet APIErrCode = "invalid_settings_faceting_max_values_per_facet" // APIErrCodeInvalidSettingsFilterableAttributes The value of filterable attributes is invalid. It should be an empty array, an array of strings, or set to null. APIErrCodeInvalidSettingsFilterableAttributes APIErrCode = "invalid_settings_filterable_attributes" // APIErrCodeInvalidSettingsPagination The value for the maxTotalHits field is invalid. It should either be an integer or set to null. APIErrCodeInvalidSettingsPagination APIErrCode = "invalid_settings_pagination" // APIErrCodeInvalidSettingsRankingRules The settings payload has an invalid ranking rules format. APIErrCodeInvalidSettingsRankingRules APIErrCode = "invalid_settings_ranking_rules" // APIErrCodeInvalidSettingsSearchableAttributes The value of searchable attributes is invalid. It should be an empty array, an array of strings or set to null. APIErrCodeInvalidSettingsSearchableAttributes APIErrCode = "invalid_settings_searchable_attributes" // APIErrCodeInvalidSettingsSearchCutoffMS The specified value for searchCutoffMs is invalid. It should be an integer indicating the cutoff in milliseconds. APIErrCodeInvalidSettingsSearchCutoffMS APIErrCode = "invalid_settings_search_cutoff_ms" // APIErrCodeInvalidSettingsSortableAttributes The value of sortable attributes is invalid. It should be an empty array, an array of strings or set to null. APIErrCodeInvalidSettingsSortableAttributes APIErrCode = "invalid_settings_sortable_attributes" // APIErrCodeInvalidSettingsStopWords The value of stop words is invalid. It should be an empty array, an array of strings or set to null. APIErrCodeInvalidSettingsStopWords APIErrCode = "invalid_settings_stop_words" // APIErrCodeInvalidSettingsSynonyms The value of the synonyms is invalid. It should either be an object or set to null. APIErrCodeInvalidSettingsSynonyms APIErrCode = "invalid_settings_synonyms" // APIErrCodeInvalidSettingsTypoTolerance Typo tolerance field is invalid. APIErrCodeInvalidSettingsTypoTolerance APIErrCode = "invalid_settings_typo_tolerance" // APIErrCodeInvalidSimilarID The provided target document identifier is invalid. APIErrCodeInvalidSimilarID APIErrCode = "invalid_similar_id" // APIErrCodeNotFoundSimilarID Meilisearch could not find the target document. APIErrCodeNotFoundSimilarID APIErrCode = "not_found_similar_id" // APIErrCodeInvalidSimilarAttributesToRetrieve attributesToRetrieve is invalid. It should be an array of strings, a string, or set to null. APIErrCodeInvalidSimilarAttributesToRetrieve APIErrCode = "invalid_similar_attributes_to_retrieve" // APIErrCodeInvalidSimilarEmbedder embedder is invalid. It should be a string corresponding to the name of a configured embedder. APIErrCodeInvalidSimilarEmbedder APIErrCode = "invalid_similar_embedder" // APIErrCodeInvalidSimilarFilter filter is invalid or contains a filter expression with a missing or invalid operator. APIErrCodeInvalidSimilarFilter APIErrCode = "invalid_similar_filter" // APIErrCodeInvalidSimilarLimit limit is invalid. It should be an integer. APIErrCodeInvalidSimilarLimit APIErrCode = "invalid_similar_limit" // APIErrCodeInvalidSimilarOffset offset is invalid. It should be an integer. APIErrCodeInvalidSimilarOffset APIErrCode = "invalid_similar_offset" // APIErrCodeInvalidSimilarShowRankingScore ranking_score is invalid. It should be a boolean. APIErrCodeInvalidSimilarShowRankingScore APIErrCode = "invalid_similar_score" // APIErrCodeInvalidSimilarShowRankingScoreDetails ranking_score_details is invalid. It should be a boolean. APIErrCodeInvalidSimilarShowRankingScoreDetails APIErrCode = "invalid_similar_score_details" // APIErrCodeInvalidSimilarRankingScoreThreshold The rankingScoreThreshold in a similar documents request is not a number between 0.0 and 1.0. APIErrCodeInvalidSimilarRankingScoreThreshold APIErrCode = "invalid_similar_ranking_score_threshold" // APIErrCodeInvalidState The database is in an invalid state. Deleting the database and re-indexing should solve the problem. APIErrCodeInvalidState APIErrCode = "invalid_state" // APIErrCodeInvalidStoreFile The data.ms folder is in an invalid state. Your b file is corrupted or the data.ms folder has been replaced by a file. APIErrCodeInvalidStoreFile APIErrCode = "invalid_store_file" // APIErrCodeInvalidSwapDuplicateIndexFound The indexes used in the indexes array for a swap index request have been declared multiple times. You must declare each index only once. APIErrCodeInvalidSwapDuplicateIndexFound APIErrCode = "invalid_swap_duplicate_index_found" // APIErrCodeInvalidSwapIndexes The payload doesn't contain exactly two index uids for a swap operation or contains an invalid index name. APIErrCodeInvalidSwapIndexes APIErrCode = "invalid_swap_indexes" // APIErrCodeInvalidTaskAfterEnqueuedAt The afterEnqueuedAt query parameter is invalid. APIErrCodeInvalidTaskAfterEnqueuedAt APIErrCode = "invalid_task_after_enqueued_at" // APIErrCodeInvalidTaskAfterFinishedAt The afterFinishedAt query parameter is invalid. APIErrCodeInvalidTaskAfterFinishedAt APIErrCode = "invalid_task_after_finished_at" // APIErrCodeInvalidTaskAfterStartedAt The afterStartedAt query parameter is invalid. APIErrCodeInvalidTaskAfterStartedAt APIErrCode = "invalid_task_after_started_at" // APIErrCodeInvalidTaskBeforeEnqueuedAt The beforeEnqueuedAt query parameter is invalid. APIErrCodeInvalidTaskBeforeEnqueuedAt APIErrCode = "invalid_task_before_enqueued_at" // APIErrCodeInvalidTaskBeforeFinishedAt The beforeFinishedAt query parameter is invalid. APIErrCodeInvalidTaskBeforeFinishedAt APIErrCode = "invalid_task_before_finished_at" // APIErrCodeInvalidTaskBeforeStartedAt The beforeStartedAt query parameter is invalid. APIErrCodeInvalidTaskBeforeStartedAt APIErrCode = "invalid_task_before_started_at" // APIErrCodeInvalidTaskCanceledBy The canceledBy query parameter is invalid. It should be an integer. Multiple uids should be separated by commas. APIErrCodeInvalidTaskCanceledBy APIErrCode = "invalid_task_canceled_by" // APIErrCodeInvalidTaskIndexUIDs The indexUids query parameter contains an invalid index uid. APIErrCodeInvalidTaskIndexUIDs APIErrCode = "invalid_task_index_uids" // APIErrCodeInvalidTaskLimit The limit parameter is invalid. It must be an integer. APIErrCodeInvalidTaskLimit APIErrCode = "invalid_task_limit" // APIErrCodeInvalidTaskStatuses The requested task status is invalid. Please use one of the possible values. APIErrCodeInvalidTaskStatuses APIErrCode = "invalid_task_statuses" // APIErrCodeInvalidTaskTypes The requested task type is invalid. Please use one of the possible values. APIErrCodeInvalidTaskTypes APIErrCode = "invalid_task_types" // APIErrCodeInvalidTaskUIDs The uids query parameter is invalid. APIErrCodeInvalidTaskUIDs APIErrCode = "invalid_task_uids" // APIErrCodeInvalidWebhooks The create webhook request did not contain a valid JSON payload. Meilisearch also returns this error when you try to create more than 20 webhooks. APIErrCodeInvalidWebhooks APIErrCode = "invalid_webhooks" // APIErrCodeInvalidWebhookURL The provided webhook URL isnβt a valid JSON string, is null, is missing, or its value cannot be parsed as a valid URL. APIErrCodeInvalidWebhookURL APIErrCode = "invalid_webhook_url" // APIErrCodeInvalidWebhookHeaders The provided webhook headers field is not a JSON object or not a valid HTTP header. Meilisearch also returns this error if you set more than 200 header fields for a single webhook. APIErrCodeInvalidWebhookHeaders APIErrCode = "invalid_webhook_headers" // APIErrCodeInvalidWebhookUUID The provided webhook uuid is not a valid uuid v4 value. APIErrCodeInvalidWebhookUUID APIErrCode = "invalid_webhook_uuid" // APIErrCodeIOError This error generally occurs when the host system has no space left on the device or when the database doesn't have read or write access. APIErrCodeIOError APIErrCode = "io_error" // APIErrCodeIndexPrimaryKeyNoCandidateFound Primary key inference failed as the received documents do not contain any fields ending with id. Manually designate the primary key, or add some field ending with id to your documents. APIErrCodeIndexPrimaryKeyNoCandidateFound APIErrCode = "index_primary_key_no_candidate_found" // APIErrCodeMalformedPayload The Content-Type header does not match the request body payload format or the format is invalid. APIErrCodeMalformedPayload APIErrCode = "malformed_payload" // APIErrCodeMissingAPIKeyActions The actions field is missing from payload. APIErrCodeMissingAPIKeyActions APIErrCode = "missing_api_key_actions" // APIErrCodeMissingAPIKeyExpiresAt The expiresAt field is missing from payload. APIErrCodeMissingAPIKeyExpiresAt APIErrCode = "missing_api_key_expires_at" // APIErrCodeMissingAPIKeyIndexes The indexes field is missing from payload. APIErrCodeMissingAPIKeyIndexes APIErrCode = "missing_api_key_indexes" // APIErrCodeMissingAuthorizationHeader This error happens if the requested resources are protected with an API key that was not provided in the request header. APIErrCodeMissingAuthorizationHeader APIErrCode = "missing_authorization_header" // APIErrCodeMissingContentType The payload does not contain a Content-Type header. Currently, Meilisearch only supports JSON, CSV, and NDJSON. APIErrCodeMissingContentType APIErrCode = "missing_content_type" // APIErrCodeMissingDocumentFilter This payload is missing the filter field. APIErrCodeMissingDocumentFilter APIErrCode = "missing_document_filter" // APIErrCodeMissingDocumentID A document does not contain any value for the required primary key, and is thus invalid. Check documents in the current addition for the invalid ones. APIErrCodeMissingDocumentID APIErrCode = "missing_document_id" // APIErrCodeMissingIndexUID The payload is missing the uid field. APIErrCodeMissingIndexUID APIErrCode = "missing_index_uid" // APIErrCodeMissingFacetSearchFacetName The facetName parameter is required. APIErrCodeMissingFacetSearchFacetName APIErrCode = "missing_facet_search_facet_name" // APIErrCodeMissingMasterKey You need to set a master key before you can access the /keys route. APIErrCodeMissingMasterKey APIErrCode = "missing_master_key" // APIErrCodeMissingNetworkURL One of the remotes in the network object does not contain the url field. APIErrCodeMissingNetworkURL APIErrCode = "missing_network_url" // APIErrCodeMissingPayload The Content-Type header was specified, but no request body was sent to the server or the request body is empty. APIErrCodeMissingPayload APIErrCode = "missing_payload" // APIErrCodeMissingSwapIndexes The index swap payload is missing the indexes object. APIErrCodeMissingSwapIndexes APIErrCode = "missing_swap_indexes" // APIErrCodeMissingTaskFilters The cancel tasks and delete tasks endpoints require one of the available query parameters. APIErrCodeMissingTaskFilters APIErrCode = "missing_task_filters" // APIErrCodeNoSpaceLeftOnDevice The host system partition reaches its maximum capacity and can no longer accept writes or the tasks queue reaches its limit. APIErrCodeNoSpaceLeftOnDevice APIErrCode = "no_space_left_on_device" // APIErrCodeNotFound The requested resources could not be found. APIErrCodeNotFound APIErrCode = "not_found" // APIErrCodePayloadTooLarge The payload sent to the server was too large. APIErrCodePayloadTooLarge APIErrCode = "payload_too_large" // APIErrCodeTaskNotFound The requested task does not exist. Please ensure that you are using the correct uid. APIErrCodeTaskNotFound APIErrCode = "task_not_found" // APIErrCodeTooManyOpenFiles Indexing a large batch of documents can result in Meilisearch opening too many file descriptors. APIErrCodeTooManyOpenFiles APIErrCode = "too_many_open_files" // APIErrCodeTooManySearchRequests You have reached the limit of concurrent search requests. APIErrCodeTooManySearchRequests APIErrCode = "too_many_search_requests" // APIErrCodeUnretrievableDocument The document exists in store, but there was an error retrieving it. This probably comes from an inconsistent state in the database. APIErrCodeUnretrievableDocument APIErrCode = "unretrievable_document" // APIErrCodeVectorEmbeddingError Error while generating embeddings. APIErrCodeVectorEmbeddingError APIErrCode = "vector_embedding_error" // APIErrCodeRemoteBadResponse The remote instance answered with a response that this instance could not use as a federated search response. APIErrCodeRemoteBadResponse APIErrCode = "remote_bad_response" // APIErrCodeRemoteBadRequest The remote instance answered with 400 BAD REQUEST. APIErrCodeRemoteBadRequest APIErrCode = "remote_bad_request" // APIErrCodeRemoteCouldNotSendRequest There was an error while sending the remote federated search request. APIErrCodeRemoteCouldNotSendRequest APIErrCode = "remote_could_not_send_request" // APIErrCodeRemoteInvalidAPIKey The remote instance answered with 403 FORBIDDEN or 401 UNAUTHORIZED to this instanceβs request. APIErrCodeRemoteInvalidAPIKey APIErrCode = "remote_invalid_api_key" // APIErrCodeRemoteRemoteError The remote instance answered with 500 INTERNAL ERROR. APIErrCodeRemoteRemoteError APIErrCode = "remote_remote_error" // APIErrCodeRemoteTimeout The proxy did not answer in the allocated time. APIErrCodeRemoteTimeout APIErrCode = "remote_timeout" // APIErrCodeWebhookNotFound The provided webhook uuid does not correspond to any configured webhooks in the instance. APIErrCodeWebhookNotFound APIErrCode = "webhook_not_found" )
type APIErrorDetails ΒΆ added in v0.37.0
type APIErrorDetails struct {
Message string `json:"message"`
Code APIErrCode `json:"code"`
Type string `json:"type"`
Link string `json:"link"`
}
APIErrorDetails represents the details of an error returned by Meilisearch API.
type AddWebhookRequest ΒΆ added in v0.33.1
type AttributeFeatures ΒΆ added in v0.33.0
type AttributeFeatures struct {
FacetSearch bool `json:"facetSearch"`
Filter FilterFeatures `json:"filter"`
}
type AttributeRule ΒΆ added in v0.33.0
type AttributeRule struct {
AttributePatterns []string `json:"attributePatterns"`
Features AttributeFeatures `json:"features"`
}
type Batch ΒΆ added in v0.33.0
type Batch struct {
UID int `json:"uid"`
Progress *BatchProgress `json:"progress,omitempty"`
Details map[string]interface{} `json:"details,omitempty"`
Stats *BatchStats `json:"stats,omitempty"`
Duration string `json:"duration,omitempty"`
StartedAt time.Time `json:"startedAt,omitempty"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
BatchStrategy string `json:"batchStrategy,omitempty"`
}
Batch gives information about the progress of batch of asynchronous operations.
type BatchProgress ΒΆ added in v0.33.0
type BatchProgress struct {
Steps []*BatchProgressStep `json:"steps"`
Percentage float64 `json:"percentage"`
}
type BatchProgressStep ΒΆ added in v0.33.0
type BatchStats ΒΆ added in v0.33.0
type BatchStats struct {
TotalNbTasks int `json:"totalNbTasks"`
Status map[string]int `json:"status"`
Types map[string]int `json:"types"`
IndexedUIDs map[string]int `json:"indexUids"`
ProgressTrace map[string]string `json:"progressTrace"`
WriteChannelCongestion *BatchStatsWriteChannelCongestion `json:"writeChannelCongestion"`
InternalDatabaseSizes *BatchStatsInternalDatabaseSize `json:"internalDatabaseSizes"`
}
type BatchStatsInternalDatabaseSize ΒΆ added in v0.33.0
type BatchStatsInternalDatabaseSize struct {
ExternalDocumentsIDs string `json:"externalDocumentsIds"`
WordDocIDs string `json:"wordDocids"`
WordPairProximityDocIDs string `json:"wordPairProximityDocids"`
WordPositionDocIDs string `json:"wordPositionDocids"`
WordFidDocIDs string `json:"wordFidDocids"`
FieldIdWordCountDocIDs string `json:"fieldIdWordCountDocids"`
Documents string `json:"documents"`
}
type BatchStatsWriteChannelCongestion ΒΆ added in v0.33.0
type BatchesQuery ΒΆ added in v0.33.0
type BatchesQuery struct {
UIDs []int64
BatchUIDs []int64
IndexUIDs []string
Statuses []string
Types []string
Limit int64
From int64
Reverse bool
BeforeEnqueuedAt time.Time
BeforeStartedAt time.Time
BeforeFinishedAt time.Time
AfterEnqueuedAt time.Time
AfterStartedAt time.Time
AfterFinishedAt time.Time
}
BatchesQuery represents the query parameters for listing batches.
type BatchesResults ΒΆ added in v0.33.0
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
type Chat ΒΆ added in v0.33.1
type Chat struct {
Description string `json:"description,omitempty"`
DocumentTemplate string `json:"documentTemplate,omitempty"`
DocumentTemplateMaxBytes int `json:"documentTemplateMaxBytes,omitempty"`
SearchParameters *SearchParameters `json:"searchParameters,omitempty"`
}
type ChatCompletionChoice ΒΆ added in v0.33.1
type ChatCompletionChoice struct {
Index int64 `json:"index"`
Delta *ChatCompletionChoiceDelta `json:"delta"`
FinishReason *string `json:"finish_reason,omitempty"`
Logprobs any `json:"logprobs"`
}
type ChatCompletionChoiceDelta ΒΆ added in v0.33.1
type ChatCompletionMessage ΒΆ added in v0.33.1
type ChatCompletionQuery ΒΆ added in v0.33.1
type ChatCompletionQuery struct {
Model string `json:"model"`
Messages []*ChatCompletionMessage `json:"messages"`
Stream bool `json:"stream"`
}
type ChatCompletionStreamChunk ΒΆ added in v0.33.1
type ChatCompletionStreamChunk struct {
ID string `json:"id"`
Object *string `json:"object,omitempty"`
Created Timestampz `json:"created,omitempty"`
Model string `json:"model,omitempty"`
Choices []*ChatCompletionChoice `json:"choices"`
ServiceTier *string `json:"service_tier,omitempty"`
SystemFingerprint *string `json:"system_fingerprint,omitempty"`
Usage any `json:"usage,omitempty"`
}
type ChatManager ΒΆ added in v0.33.1
type ChatManager interface {
ChatReader
// UpdateChatWorkspace updates a chat workspace by its ID.
UpdateChatWorkspace(ctx context.Context, uid string, settings *ChatWorkspaceSettings) (*ChatWorkspaceSettings, error)
// ResetChatWorkspace resets a chat workspace by its ID.
ResetChatWorkspace(ctx context.Context, uid string) (*ChatWorkspaceSettings, error)
}
type ChatReader ΒΆ added in v0.33.1
type ChatReader interface {
// ChatCompletionStream retrieves a stream of chat completions for a given workspace and query.
ChatCompletionStream(ctx context.Context, workspace string, query *ChatCompletionQuery) (*Stream[*ChatCompletionStreamChunk], error)
// ListChatWorkspaces retrieves all chat workspaces.
ListChatWorkspaces(ctx context.Context, query *ListChatWorkSpaceQuery) (*ListChatWorkspace, error)
// GetChatWorkspace retrieves a chat workspace by its ID.
GetChatWorkspace(ctx context.Context, uid string) (*ChatWorkspace, error)
// GetChatWorkspaceSettings retrieves chat workspace settings by its ID.
GetChatWorkspaceSettings(ctx context.Context, uid string) (*ChatWorkspaceSettings, error)
}
type ChatRole ΒΆ added in v0.33.1
type ChatRole string
ChatRole The role of a message in a chat conversation.
type ChatSource ΒΆ added in v0.33.1
type ChatSource string
ChatSource The source corresponds to a service that generates chat completions from your messages.
const ( OpenaiChatSource ChatSource = "openAi" AzureOpenAiChatSource ChatSource = "azureOpenAi" MistralChatSource ChatSource = "mistral" GeminiChatSource ChatSource = "gemini" VLlmChatSource ChatSource = "vLlm" )
type ChatWorkspace ΒΆ added in v0.33.1
type ChatWorkspace struct {
UID string `json:"uid"`
}
type ChatWorkspaceSettings ΒΆ added in v0.33.1
type ChatWorkspaceSettings struct {
Source ChatSource `json:"source"`
OrgId string `json:"orgId"`
ProjectId string `json:"projectId"`
ApiVersion string `json:"apiVersion"`
DeploymentId string `json:"deploymentId"`
BaseUrl string `json:"baseUrl"`
ApiKey string `json:"apiKey,omitempty"`
Prompts *ChatWorkspaceSettingsPrompts `json:"prompts"`
}
type ChatWorkspaceSettingsPrompts ΒΆ added in v0.33.1
type Conditions ΒΆ added in v0.37.0
type Conditions struct {
Query *QueryCondition `json:"query,omitempty"`
Time *TimeCondition `json:"time,omitempty"`
Filter *FilterCondition `json:"filter,omitempty"`
}
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
type CsvDocumentsQuery ΒΆ added in v0.24.0
type CsvDocumentsQuery struct {
PrimaryKey string `json:"primaryKey,omitempty"`
CsvDelimiter string `json:"csvDelimiter,omitempty"`
SkipCreation bool `json:"skipCreation,omitempty"`
// TaskCustomMetadata is the custom metadata to add to the task.
// This string will be associated with the task and visible in the task details.
// It is optional.
TaskCustomMetadata string `json:"-"`
}
type Decoder ΒΆ added in v0.33.1
type Decoder interface {
Next() bool // advances to next event; false on EOF or error
Event() Event // returns the current event
Err() error // returns the terminal error (if any)
Close() error // closes the underlying stream
}
func NewDecoder ΒΆ added in v0.33.1
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
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 []interface{} `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"`
}
type Distribution ΒΆ added in v0.30.0
type Distribution struct {
Mean float64 `json:"mean"` // Mean of the distribution
Sigma float64 `json:"sigma"` // Sigma (standard deviation) of the distribution
}
Distribution represents a statistical distribution with mean and standard deviation (sigma).
type DocumentManager ΒΆ added in v0.30.0
type DocumentManager interface {
DocumentReader
// AddDocuments adds multiple documents to the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocuments(ctx context.Context, documentsPtr interface{}, opts *DocumentOptions) (*TaskInfo, error)
// AddDocumentsInBatches adds documents to the index in batches of specified size.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsInBatches(ctx context.Context, documentsPtr interface{}, batchSize int, opts *DocumentOptions) ([]TaskInfo, error)
// AddDocumentsCsv adds documents from a CSV byte array to the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsCsv(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.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsCsvInBatches(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.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsCsvFromReaderInBatches(ctx context.Context, documents io.Reader, batchSize int, options *CsvDocumentsQuery) ([]TaskInfo, error)
// AddDocumentsCsvFromReader adds documents from a CSV reader to the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsCsvFromReader(ctx context.Context, documents io.Reader, options *CsvDocumentsQuery) (*TaskInfo, error)
// AddDocumentsNdjson adds documents from a NDJSON byte array to the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsNdjson(ctx context.Context, documents []byte, opts *DocumentOptions) (*TaskInfo, error)
// AddDocumentsNdjsonInBatches adds documents from a NDJSON byte array to the index in batches of specified size.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsNdjsonInBatches(ctx context.Context, documents []byte, batchSize int, opts *DocumentOptions) ([]TaskInfo, error)
// AddDocumentsNdjsonFromReader adds documents from a NDJSON reader to the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsNdjsonFromReader(ctx context.Context, documents io.Reader, opts *DocumentOptions) (*TaskInfo, error)
// AddDocumentsNdjsonFromReaderInBatches adds documents from a NDJSON reader to the index in batches of specified size.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
AddDocumentsNdjsonFromReaderInBatches(ctx context.Context, documents io.Reader, batchSize int, opts *DocumentOptions) ([]TaskInfo, error)
// UpdateDocuments updates multiple documents in the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
UpdateDocuments(ctx context.Context, documentsPtr interface{}, opts *DocumentOptions) (*TaskInfo, error)
// UpdateDocumentsInBatches updates documents in the index in batches of specified size.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
UpdateDocumentsInBatches(ctx context.Context, documentsPtr interface{}, batchSize int, opts *DocumentOptions) ([]TaskInfo, error)
// UpdateDocumentsCsv updates documents in the index from a CSV byte array.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
UpdateDocumentsCsv(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.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
UpdateDocumentsCsvInBatches(ctx context.Context, documents []byte, batchsize int, options *CsvDocumentsQuery) ([]TaskInfo, error)
// UpdateDocumentsNdjson updates documents in the index from a NDJSON byte array.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
UpdateDocumentsNdjson(ctx context.Context, documents []byte, opts *DocumentOptions) (*TaskInfo, error)
// UpdateDocumentsNdjsonInBatches updates documents in the index from a NDJSON byte array in batches of specified size.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
UpdateDocumentsNdjsonInBatches(ctx context.Context, documents []byte, batchsize int, opts *DocumentOptions) ([]TaskInfo, error)
// UpdateDocumentsByFunction update documents by using function
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
UpdateDocumentsByFunction(ctx context.Context, req *UpdateDocumentByFunctionRequest) (*TaskInfo, error)
// DeleteDocument deletes a single document from the index by identifier.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/delete-document
DeleteDocument(ctx context.Context, identifier string, opts *DocumentOptions) (*TaskInfo, error)
// DeleteDocuments deletes multiple documents from the index by identifiers.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/delete-document
DeleteDocuments(ctx context.Context, identifiers []string, opts *DocumentOptions) (*TaskInfo, error)
// DeleteDocumentsByFilter deletes documents from the index by filter.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/delete-documents-by-filter
DeleteDocumentsByFilter(ctx context.Context, filter interface{}, opts *DocumentOptions) (*TaskInfo, error)
// DeleteAllDocuments deletes all documents from the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/delete-all-documents
DeleteAllDocuments(ctx context.Context, opts *DocumentOptions) (*TaskInfo, error)
}
type DocumentOptions ΒΆ added in v0.35.0
type DocumentOptions struct {
PrimaryKey *string `json:"primaryKey,omitempty"`
SkipCreation bool `json:"skipCreation,omitempty"`
// TaskCustomMetadata is the custom metadata to add to the task.
// This string will be associated with the task and visible in the task details.
// It is optional.
TaskCustomMetadata string `json:"-"`
}
DocumentOptions is the options struct for adding or updating documents (JSON/NDJSON) and deleting documents.
type DocumentQuery ΒΆ added in v0.20.0
type DocumentQuery struct {
Fields []string `json:"fields,omitempty"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
}
DocumentQuery is the request body get one documents method
type DocumentReader ΒΆ added in v0.30.0
type DocumentReader interface {
// GetDocument retrieves a single document from the index by identifier.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/get-document
GetDocument(ctx context.Context, identifier string, request *DocumentQuery, documentPtr interface{}) error
// GetDocuments retrieves multiple documents from the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/documents/list-documents-with-get
GetDocuments(ctx context.Context, param *DocumentsQuery, resp *DocumentsResult) error
}
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"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
Ids []string `json:"ids,omitempty"`
Sort []string `json:"sort,omitempty"`
}
DocumentsQuery is the request body for list documents method
type DocumentsResult ΒΆ added in v0.20.0
type Embedder ΒΆ added in v0.26.3
type Embedder struct {
Source EmbedderSource `json:"source"` // The type of embedder: "openAi", "huggingFace", "userProvided", "rest", "ollama"
// URL Meilisearch queries url to generate vector embeddings for queries and documents.
// url must point to a REST-compatible embedder. You may also use url to work with proxies, such as when targeting openAi from behind a proxy.
URL string `json:"url,omitempty"` // Optional for "openAi", "rest", "ollama"
APIKey string `json:"apiKey,omitempty"` // Optional for "openAi", "rest", "ollama"
// Model The model your embedder uses when generating vectors.
// These are the officially supported models Meilisearch supports:
//
// - openAi: text-embedding-3-small, text-embedding-3-large, openai-text-embedding-ada-002
//
// - huggingFace: BAAI/bge-base-en-v1.5
//
// Other models, such as HuggingFaceβs BERT models or those provided by Ollama and REST embedders
// may also be compatible with Meilisearch.
//
// HuggingFaceβs BERT models: https://huggingface.co/models?other=bert
Model string `json:"model,omitempty"` // Optional for "openAi", "huggingFace", "ollama"
// DocumentTemplate is a string containing a Liquid template. Meillisearch interpolates the template for each
// document and sends the resulting text to the embedder. The embedder then generates document vectors based on this text.
DocumentTemplate string `json:"documentTemplate,omitempty"` // Optional for most embedders
// DocumentTemplateMaxBytes The maximum size of a rendered document template.
//Longer texts are truncated to fit the configured limit.
//
// documentTemplateMaxBytes must be an integer. It defaults to 400.
DocumentTemplateMaxBytes int `json:"documentTemplateMaxBytes,omitempty"`
Dimensions int `json:"dimensions,omitempty"` // Optional for "openAi", "rest", "userProvided", "ollama"
Revision string `json:"revision,omitempty"` // Optional for "huggingFace"
Distribution *Distribution `json:"distribution,omitempty"` // Optional for all embedders
Request map[string]interface{} `json:"request,omitempty"` // Optional for "rest"
Response map[string]interface{} `json:"response,omitempty"` // Optional for "rest"
Headers map[string]string `json:"headers,omitempty"` // Optional for "rest"
BinaryQuantized bool `json:"binaryQuantized,omitempty"`
Pooling EmbedderPooling `json:"pooling,omitempty"`
IndexingEmbedder *Embedder `json:"indexingEmbedder,omitempty"` // For Composite
SearchEmbedder *Embedder `json:"searchEmbedder,omitempty"` // For Composite
IndexingFragments map[string]Fragment `json:"indexingFragments,omitempty"`
SearchFragments map[string]Fragment `json:"searchFragments,omitempty"`
}
Embedder represents a unified configuration for various embedder types.
Specs: https://www.meilisearch.com/docs/reference/api/settings#body-21
type EmbedderPooling ΒΆ added in v0.33.0
type EmbedderPooling string
EmbedderPooling Configure how Meilisearch should merge individual tokens into a single embedding.
pooling is optional for embedders with the huggingFace source.
const ( // UseModelEmbedderPooling Meilisearch will fetch the pooling method from the model configuration. Default value for new embedders UseModelEmbedderPooling EmbedderPooling = "useModel" // ForceMeanEmbedderPooling always use mean pooling. Default value for embedders created in Meilisearch <=v1.13 ForceMeanEmbedderPooling EmbedderPooling = "forceMean" // ForceClsEmbedderPooling always use CLS pooling ForceClsEmbedderPooling EmbedderPooling = "forceCls" )
type EmbedderSource ΒΆ added in v0.33.0
type EmbedderSource string
EmbedderSource The source corresponds to a service that generates embeddings from your documents.
const ( OpenaiEmbedderSource EmbedderSource = "openAi" HuggingFaceEmbedderSource EmbedderSource = "huggingFace" // RestEmbedderSource rest is a generic source compatible with any embeddings provider offering a REST API. RestEmbedderSource EmbedderSource = "rest" OllamaEmbedderSource EmbedderSource = "ollama" // UserProvidedEmbedderSource Use userProvided when you want to generate embeddings manually. In this case, // you must include vector data in your documentsβ _vectors field. You must also generate //vectors for search queries. UserProvidedEmbedderSource EmbedderSource = "userProvided" // CompositeEmbedderSource Choose composite to use one embedder during indexing time, and another embedder at search time. //Must be used together with indexingEmbedder and searchEmbedder. CompositeEmbedderSource EmbedderSource = "composite" )
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 // APIError send by the meilisearch api APIError // APIErrorWithoutMessage APIError send by the meilisearch api APIErrorWithoutMessage TimeoutError // CommunicationError impossible execute a request CommunicationError // MaxRetriesExceeded used max retries and exceeded MaxRetriesExceeded )
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)
APIError APIErrorDetails
// StatusCode of the request
StatusCode int
// StatusCode expected by the endpoint to be considered as a success
StatusCodeExpected []int
// OriginError is the origin error that produce the current Error. It can be nil in case of a bad status code.
OriginError error
// ErrCode is the internal error code that represent the different step when executing a request that can produce
// an error.
ErrCode ErrCode
// contains filtered or unexported fields
}
Error is the internal error structure that all exposed method use. So ALL errors returned by this library can be cast to this struct (as a pointer)
func (*Error) HasCode ΒΆ added in v0.37.0
func (e *Error) HasCode(code APIErrCode) bool
HasCode returns true if the Meilisearch API error code matches the given code.
type ExperimentalFeatures ΒΆ added in v0.29.0
type ExperimentalFeatures struct {
ExperimentalFeaturesBase
// contains filtered or unexported fields
}
func (*ExperimentalFeatures) Get ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) Get(ctx context.Context) (*ExperimentalFeaturesResult, error)
func (*ExperimentalFeatures) SetChatCompletions ΒΆ added in v0.33.1
func (ef *ExperimentalFeatures) SetChatCompletions(enable bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetCompositeEmbedders ΒΆ added in v0.33.0
func (ef *ExperimentalFeatures) SetCompositeEmbedders(enable bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetContainsFilter ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) SetContainsFilter(containsFilter bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetDynamicSearchRules ΒΆ added in v0.36.3
func (ef *ExperimentalFeatures) SetDynamicSearchRules(dynamicSearchRule bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetEditDocumentsByFunction ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) SetEditDocumentsByFunction(editDocumentsByFunction bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetForeignKeys ΒΆ added in v0.37.0
func (ef *ExperimentalFeatures) SetForeignKeys(enable bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetGetTaskDocumentsRoute ΒΆ added in v0.36.3
func (ef *ExperimentalFeatures) SetGetTaskDocumentsRoute(enable 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) SetMultiModal ΒΆ added in v0.33.1
func (ef *ExperimentalFeatures) SetMultiModal(enable bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetNetwork ΒΆ added in v0.33.0
func (ef *ExperimentalFeatures) SetNetwork(enable bool) *ExperimentalFeatures
func (*ExperimentalFeatures) SetRenderRoute ΒΆ added in v0.37.0
func (ef *ExperimentalFeatures) SetRenderRoute(renderRoot bool) *ExperimentalFeatures
func (*ExperimentalFeatures) Update ΒΆ added in v0.29.0
func (ef *ExperimentalFeatures) Update(ctx context.Context) (*ExperimentalFeaturesResult, error)
type ExperimentalFeaturesBase ΒΆ added in v0.29.0
type ExperimentalFeaturesBase struct {
LogsRoute *bool `json:"logsRoute,omitempty"`
Metrics *bool `json:"metrics,omitempty"`
EditDocumentsByFunction *bool `json:"editDocumentsByFunction,omitempty"`
ContainsFilter *bool `json:"containsFilter,omitempty"`
Network *bool `json:"network,omitempty"`
CompositeEmbedders *bool `json:"compositeEmbedders,omitempty"`
ChatCompletions *bool `json:"chatCompletions,omitempty"`
MultiModal *bool `json:"multimodal,omitempty"`
DynamicSearchRules *bool `json:"dynamicSearchRules,omitempty"`
GetTaskDocumentsRoute *bool `json:"getTaskDocumentsRoute,omitempty"`
RenderRoute *bool `json:"renderRoute,omitempty"`
ForeignKeys *bool `json:"foreignKeys,omitempty"`
}
ExperimentalFeaturesBase represents the experimental features result from the API.
type ExperimentalFeaturesResult ΒΆ added in v0.29.0
type ExperimentalFeaturesResult struct {
LogsRoute bool `json:"logsRoute"`
Metrics bool `json:"metrics"`
EditDocumentsByFunction bool `json:"editDocumentsByFunction"`
ContainsFilter bool `json:"containsFilter"`
Network bool `json:"network"`
CompositeEmbedders bool `json:"compositeEmbedders"`
ChatCompletions bool `json:"chatCompletions"`
MultiModal bool `json:"multimodal"`
DynamicSearchRules bool `json:"dynamicSearchRules"`
GetTaskDocumentsRoute bool `json:"getTaskDocumentsRoute"`
RenderRoute bool `json:"renderRoute"`
ForeignKeys bool `json:"foreignKeys"`
Personalize *SearchRequestPersonalize `json:"personalize,omitempty"`
}
type ExportParams ΒΆ added in v0.33.1
type ExportParams struct {
URL string `json:"url,omitempty"`
APIKey string `json:"apiKey,omitempty"`
PayloadSize string `json:"payloadSize,omitempty"`
Indexes map[string]IndexExportOptions `json:"indexes,omitempty"`
}
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 interface{} `json:"filter,omitempty"`
MatchingStrategy string `json:"matchingStrategy,omitempty"`
AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"`
ExhaustiveFacetCount bool `json:"exhaustiveFacetCount,omitempty"`
}
type FacetSearchResponse ΒΆ added in v0.27.1
type Faceting ΒΆ added in v0.20.1
type Faceting struct {
MaxValuesPerFacet int64 `json:"maxValuesPerFacet"`
// SortFacetValuesBy index_name: alpha|count|sampledCount
SortFacetValuesBy map[string]SortFacetType `json:"sortFacetValuesBy"`
}
Faceting is the type that represents the faceting setting in meilisearch
type FilterCondition ΒΆ added in v0.37.0
type FilterCondition struct {
Values map[string]interface{} `json:"values,omitempty"`
}
FilterCondition matches when the search filter sets the given fields to the given values.
type FilterFeatures ΒΆ added in v0.33.0
type ForeignKey ΒΆ added in v0.37.0
type Health ΒΆ added in v0.13.1
type Health struct {
Status string `json:"status"`
}
Health is the request body for set meilisearch health
type Hit ΒΆ added in v0.33.0
type Hit map[string]json.RawMessage // Hit is a map of key and value raw buffer
func (Hit) DecodeInto ΒΆ added in v0.34.0
DecodeInto decodes a single Hit into the provided struct without intermediate marshaling.
func (Hit) DecodeWith ΒΆ added in v0.33.0
func (h Hit) DecodeWith(vPtr interface{}, marshal JSONMarshal, unmarshal JSONUnmarshal) error
DecodeWith decodes a Hit into the provided struct using the provided marshal and unmarshal functions.
type Hits ΒΆ added in v0.33.0
type Hits []Hit // Hits is an alias for a slice of Hit.
func (Hits) DecodeInto ΒΆ added in v0.34.0
DecodeInto decodes hs into the provided slice pointer without re-marshal. vSlicePtr must be a non-nil pointer to a slice whose element type is a struct or *struct. Example:
var out []exampleBookForTest
if err := hits.DecodeInto(&out); err != nil { ... }
var outPtr []*exampleBookForTest
if err := hits.DecodeInto(&outPtr); err != nil { ... }
func (Hits) DecodeWith ΒΆ added in v0.33.0
func (h Hits) DecodeWith(vSlicePtr interface{}, marshal JSONMarshal, unmarshal JSONUnmarshal) error
DecodeWith decodes a Hits into the provided struct using the provided marshal and unmarshal functions.
type ImportFrom ΒΆ added in v0.37.0
type ImportFrom struct {
RemoteName string `json:"remoteName"`
IndexName string `json:"indexName"`
DocumentCount int64 `json:"documentCount"`
}
ImportFrom describes the documents imported from a remote during a network topology change.
type IndexConfig ΒΆ added in v0.15.0
type IndexExportOptions ΒΆ added in v0.33.1
type IndexManager ΒΆ added in v0.28.0
type IndexManager interface {
IndexReader
TaskReader
DocumentManager
SettingsManager
SearchReader
GetIndexReader() IndexReader
GetTaskReader() TaskReader
GetDocumentManager() DocumentManager
GetDocumentReader() DocumentReader
GetSettingsManager() SettingsManager
GetSettingsReader() SettingsReader
GetSearch() SearchReader
// UpdateIndex updates the primary key of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/update-index
UpdateIndex(ctx context.Context, params *UpdateIndexRequestParams) (*TaskInfo, error)
// Delete removes the index identified by the given UID.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/delete-index
Delete(ctx context.Context, uid string) (bool, error)
// Compact compacts the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/compact-index
Compact(ctx context.Context) (*TaskInfo, error)
}
type IndexReader ΒΆ added in v0.30.0
type IndexReader interface {
// FetchInfo retrieves information about the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/get-index
FetchInfo(ctx context.Context) (*IndexResult, error)
// FetchPrimaryKey retrieves the primary key of the index.
FetchPrimaryKey(ctx context.Context) (*string, error)
// GetStats retrieves statistical information about the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/stats/get-stats-of-index
GetStats(ctx context.Context, param *StatsParams) (*StatsIndex, error)
}
type IndexResult ΒΆ added in v0.28.0
type IndexesQuery ΒΆ added in v0.20.0
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
type JSONMarshal ΒΆ added in v0.33.0
JSONMarshal returns the JSON encoding of v.
type JSONUnmarshal ΒΆ added in v0.33.0
JSONUnmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. If v is nil or not a pointer, Unmarshal returns an InvalidUnmarshalError.
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
type KeyManager ΒΆ added in v0.30.0
type KeyManager interface {
KeyReader
// CreateKey creates a new API key and returns the details of the created [Key]
//
// docs: https://www.meilisearch.com/docs/reference/api/keys/create-api-key
CreateKey(ctx context.Context, request *Key) (*Key, error)
// UpdateKey updates a specific API key.
//
// docs: https://www.meilisearch.com/docs/reference/api/keys/update-api-key
UpdateKey(ctx context.Context, keyOrUID string, request *Key) (*Key, error)
// DeleteKey deletes a specific API key.
//
// docs: https://www.meilisearch.com/docs/reference/api/keys/delete-api-key
DeleteKey(ctx context.Context, keyOrUID string) (bool, error)
}
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
type KeyReader ΒΆ added in v0.30.0
type KeyReader interface {
// GetKey fetches the details of a specific API key.
//
// docs: https://www.meilisearch.com/docs/reference/api/keys/get-api-key
GetKey(ctx context.Context, identifier string) (*Key, error)
// GetKeys lists all API keys.
//
// docs: https://www.meilisearch.com/docs/reference/api/keys/list-api-keys
GetKeys(ctx context.Context, param *KeysQuery) (*KeysResults, error)
}
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
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
type ListChatWorkSpaceQuery ΒΆ added in v0.33.1
type ListChatWorkspace ΒΆ added in v0.33.1
type ListChatWorkspace struct {
Results []*ChatWorkspace `json:"results"`
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
Total int64 `json:"total"`
}
type LocalizedAttributes ΒΆ added in v0.29.0
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
MinWordSizeForTypos is the type that represents the minWordSizeForTypos setting in the typo tolerance setting in meilisearch
type MultiSearchFederation ΒΆ added in v0.29.0
type MultiSearchFederation struct {
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
FacetsByIndex map[string][]string `json:"facetsByIndex,omitempty"`
MergeFacets *MultiSearchFederationMergeFacets `json:"mergeFacets,omitempty"`
Distinct string `json:"distinct,omitempty"`
}
type MultiSearchFederationMergeFacets ΒΆ added in v0.33.0
type MultiSearchFederationMergeFacets struct {
MaxValuesPerFacet int `json:"maxValuesPerFacet,omitempty"`
}
type MultiSearchRequest ΒΆ added in v0.24.0
type MultiSearchRequest struct {
Federation *MultiSearchFederation `json:"federation,omitempty"`
Queries []*SearchRequest `json:"queries"`
// IncludeMetadata sends the Meili-Include-Metadata header so the response includes metadata.
IncludeMetadata bool `json:"-"`
}
type MultiSearchResponse ΒΆ added in v0.24.0
type MultiSearchResponse struct {
Results []SearchResponse `json:"results,omitempty"`
Hits Hits `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"`
FacetDistribution map[string]json.RawMessage `json:"facetDistribution,omitempty"`
FacetStats map[string]json.RawMessage `json:"facetStats,omitempty"`
RemoteErrors map[string]*RemoteError `json:"remoteErrors,omitempty"`
Metadata []SearchMetadata `json:"metadata,omitempty"`
}
type Network ΒΆ added in v0.33.2
type Network struct {
Self string `json:"self,omitempty"`
Leader string `json:"leader,omitempty"`
Remotes map[string]Remote `json:"remotes,omitempty"`
Shards map[string]Shard `json:"shards,omitempty"`
Version string `json:"version,omitempty"`
}
Network represents the Meilisearch network configuration.
type Opt ΒΆ added in v0.33.2
type Opt[T any] struct { Value T // contains filtered or unexported fields }
func Bool ΒΆ added in v0.33.2
Bool creates an Opt[bool] with the given bool value and sets its status to included.
func Float ΒΆ added in v0.33.2
Float creates an Opt[float64] with the given float64 value and sets its status to included.
func Int ΒΆ added in v0.33.2
Int creates an Opt[int] with the given int value and sets its status to included.
func Int64 ΒΆ added in v0.33.2
Int64 creates an Opt[int64] with the given int64 value and sets its status to included.
func NewOpt ΒΆ added in v0.33.2
NewOpt creates an Opt[T] with the given value and sets its status to included.
func String ΒΆ added in v0.33.2
String creates an Opt[string] with the given string value and sets its status to included.
func (Opt[T]) MarshalJSON ΒΆ added in v0.33.2
func (*Opt[T]) UnmarshalJSON ΒΆ added in v0.33.2
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 WithCustomDialContext ΒΆ added in v0.33.0
func WithCustomDialContext(dial func(ctx context.Context, network, addr string) (net.Conn, error)) Option
WithCustomDialContext sets a custom dial context
func WithCustomExpectContinueTimeout ΒΆ added in v0.33.0
WithCustomExpectContinueTimeout sets the Expect-Continue timeout
func WithCustomIdleConnTimeout ΒΆ added in v0.33.0
WithCustomIdleConnTimeout sets the idle connection timeout
func WithCustomJsonMarshaler ΒΆ added in v0.33.0
func WithCustomJsonMarshaler(marshal JSONMarshal) Option
WithCustomJsonMarshaler set custom marshal from external packages instead encoding/json. we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json.
supported package: goccy/go-json, bytedance/sonic, segmentio/encoding, minio/simdjson-go, wI2L/jettison, mailru/easyjson.
default is encoding/json
func WithCustomJsonUnmarshaler ΒΆ added in v0.33.0
func WithCustomJsonUnmarshaler(unmarshal JSONUnmarshal) Option
WithCustomJsonUnmarshaler set custom unmarshal from external packages instead encoding/json. we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json.
supported package: goccy/go-json, bytedance/sonic, segmentio/encoding, minio/simdjson-go, wI2L/jettison, mailru/easyjson.
default is encoding/json
func WithCustomMaxIdleConns ΒΆ added in v0.33.0
WithCustomMaxIdleConns sets the max number of idle connections
func WithCustomMaxIdleConnsPerHost ΒΆ added in v0.33.0
WithCustomMaxIdleConnsPerHost sets max idle connections per host
func WithCustomProxy ΒΆ added in v0.33.0
WithCustomProxy sets a custom proxy function
func WithCustomRetries ΒΆ added in v0.29.0
WithCustomRetries set retry on specific http error code and max retries (min: 1, max: 255)
func WithCustomTLSHandshakeTimeout ΒΆ added in v0.33.0
WithCustomTLSHandshakeTimeout sets the TLS handshake timeout
type Origin ΒΆ added in v0.33.3
type Origin struct {
RemoteName string `json:"remoteName,omitempty"`
TaskUID int64 `json:"taskUid"`
NetworkVersion string `json:"networkVersion,omitempty"`
}
Origin identifies the remote task a task originates from.
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
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 QueryCondition ΒΆ added in v0.37.0
type Remote ΒΆ added in v0.33.2
type Remote struct {
URL string `json:"url"`
SearchAPIKey string `json:"searchApiKey"`
WriteAPIKey string `json:"writeApiKey"`
Status RemoteStatus `json:"status,omitempty"`
}
Remote describes a single remote Meilisearch node.
type RemoteError ΒΆ added in v0.33.2
type RemoteStatus ΒΆ added in v0.37.0
type RemoteStatus string
RemoteStatus is the availability of a remote, as seen by the instance answering the request.
Documentation: https://www.meilisearch.com/docs/resources/self_hosting/sharding/configure_replication#inspect-remote-availability
const ( RemoteStatusAvailable RemoteStatus = "available" )
type RenderTemplateParams ΒΆ added in v0.37.0
type RenderTemplateParams struct {
Template Template `json:"template,omitempty"`
Input *TempelateInput `json:"input,omitempty"`
}
type RenderTemplateResponse ΒΆ added in v0.37.0
type SearchFederationOptions ΒΆ added in v0.29.0
type SearchMetadata ΒΆ added in v0.37.0
type SearchMetadata struct {
Query string `json:"query,omitempty"`
QueryUID string `json:"queryUid,omitempty"`
IndexUID string `json:"indexUid,omitempty"`
PrimaryKey string `json:"primaryKey,omitempty"`
Remote string `json:"remote,omitempty"`
InlineRuleConditionOutcomes map[string]interface{} `json:"inlineRuleConditionOutcomes,omitempty"`
}
type SearchParameters ΒΆ added in v0.33.1
type SearchParameters struct {
Limit int64 `json:"limit,omitempty"`
AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"`
MatchingStrategy MatchingStrategy `json:"matchingStrategy,omitempty"`
Sort []string `json:"sort,omitempty"`
Distinct string `json:"distinct,omitempty"`
Hybrid *SearchRequestHybrid `json:"hybrid,omitempty"`
RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"`
}
type SearchReader ΒΆ added in v0.30.0
type SearchReader interface {
// Search performs a search query on the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/search/search-with-get
Search(ctx context.Context, query string, request *SearchRequest) (*SearchResponse, error)
// SearchRaw performs a raw search query on the index, returning a JSON response.
//
// docs: https://www.meilisearch.com/docs/reference/api/search/search-with-get
SearchRaw(ctx context.Context, query string, request *SearchRequest) (*json.RawMessage, error)
// FacetSearch performs a facet search query on the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/facet-search/search-in-facets
FacetSearch(ctx context.Context, request *FacetSearchRequest) (*json.RawMessage, error)
// SearchSimilarDocuments performs a search for similar documents.
//
// docs: https://www.meilisearch.com/docs/reference/api/similar-documents/get-similar-documents-with-get
SearchSimilarDocuments(ctx context.Context, param *SimilarDocumentQuery, resp *SimilarDocumentResult) error
}
type SearchRequest ΒΆ
type SearchRequest struct {
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"`
AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"`
AttributesToCrop []string `json:"attributesToCrop,omitempty"`
CropLength int64 `json:"cropLength,omitempty"`
CropMarker string `json:"cropMarker,omitempty"`
AttributesToHighlight []string `json:"attributesToHighlight,omitempty"`
HighlightPreTag string `json:"highlightPreTag,omitempty"`
HighlightPostTag string `json:"highlightPostTag,omitempty"`
MatchingStrategy MatchingStrategy `json:"matchingStrategy,omitempty"`
Filter interface{} `json:"filter,omitempty"`
ShowMatchesPosition bool `json:"showMatchesPosition,omitempty"`
ShowRankingScore bool `json:"showRankingScore,omitempty"`
ShowRankingScoreDetails bool `json:"showRankingScoreDetails,omitempty"`
ShowPerformanceDetails bool `json:"showPerformanceDetails,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"`
Locales []string `json:"locales,omitempty"`
Media map[string]any `json:"media,omitempty"`
Personalize *SearchRequestPersonalize `json:"personalize,omitempty"`
InlineRule *SearchRequestInlineRule `json:"inlineRule,omitempty"`
// IncludeMetadata sends the Meili-Include-Metadata header so the response includes metadata.
IncludeMetadata bool `json:"-"`
}
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
type SearchRequestBuilder ΒΆ added in v0.37.0
type SearchRequestBuilder struct {
// contains filtered or unexported fields
}
SearchRequestBuilder constructs a SearchRequest with a fluent API. Optional pointer fields (e.g. HitsPerPage) are managed internally.
func NewSearchRequestBuilder ΒΆ added in v0.37.0
func NewSearchRequestBuilder() *SearchRequestBuilder
NewSearchRequestBuilder starts a new search request builder.
func (*SearchRequestBuilder) Build ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) Build() *SearchRequest
Build returns the configured SearchRequest after applying SDK validation defaults.
func (*SearchRequestBuilder) WithAttributesToCrop ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithAttributesToCrop(attrs ...string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithAttributesToHighlight ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithAttributesToHighlight(attrs ...string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithAttributesToRetrieve ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithAttributesToRetrieve(attrs ...string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithAttributesToSearchOn ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithAttributesToSearchOn(attrs ...string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithCropLength ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithCropLength(v int64) *SearchRequestBuilder
func (*SearchRequestBuilder) WithCropMarker ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithCropMarker(v string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithDistinct ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithDistinct(v string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithFacets ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithFacets(facets ...string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithFederationOptions ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithFederationOptions(o *SearchFederationOptions) *SearchRequestBuilder
func (*SearchRequestBuilder) WithFilter ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithFilter(v interface{}) *SearchRequestBuilder
func (*SearchRequestBuilder) WithHighlightPostTag ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithHighlightPostTag(v string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithHighlightPreTag ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithHighlightPreTag(v string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithHitsPerPage ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithHitsPerPage(v int64) *SearchRequestBuilder
func (*SearchRequestBuilder) WithHybrid ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithHybrid(h *SearchRequestHybrid) *SearchRequestBuilder
func (*SearchRequestBuilder) WithIndexUID ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithIndexUID(v string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithInlineRule ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithInlineRule(r *SearchRequestInlineRule) *SearchRequestBuilder
WithInlineRule sets an inline search rule to preview with this search.
func (*SearchRequestBuilder) WithLimit ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithLimit(v int64) *SearchRequestBuilder
func (*SearchRequestBuilder) WithLocales ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithLocales(locales ...string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithMatchingStrategy ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithMatchingStrategy(v MatchingStrategy) *SearchRequestBuilder
func (*SearchRequestBuilder) WithMedia ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithMedia(m map[string]any) *SearchRequestBuilder
func (*SearchRequestBuilder) WithOffset ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithOffset(v int64) *SearchRequestBuilder
func (*SearchRequestBuilder) WithPage ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithPage(v int64) *SearchRequestBuilder
func (*SearchRequestBuilder) WithPersonalize ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithPersonalize(p *SearchRequestPersonalize) *SearchRequestBuilder
func (*SearchRequestBuilder) WithQuery ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithQuery(v string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithRankingScoreThreshold ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithRankingScoreThreshold(v float64) *SearchRequestBuilder
func (*SearchRequestBuilder) WithRetrieveVectors ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithRetrieveVectors(v bool) *SearchRequestBuilder
func (*SearchRequestBuilder) WithShowMatchesPosition ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithShowMatchesPosition(v bool) *SearchRequestBuilder
func (*SearchRequestBuilder) WithShowPerformanceDetails ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithShowPerformanceDetails(v bool) *SearchRequestBuilder
func (*SearchRequestBuilder) WithShowRankingScore ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithShowRankingScore(v bool) *SearchRequestBuilder
func (*SearchRequestBuilder) WithShowRankingScoreDetails ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithShowRankingScoreDetails(v bool) *SearchRequestBuilder
func (*SearchRequestBuilder) WithSort ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithSort(sort ...string) *SearchRequestBuilder
func (*SearchRequestBuilder) WithVector ΒΆ added in v0.37.0
func (b *SearchRequestBuilder) WithVector(v []float32) *SearchRequestBuilder
type SearchRequestHybrid ΒΆ added in v0.26.3
type SearchRequestInlineRule ΒΆ added in v0.37.0
type SearchRequestInlineRule struct {
Uid string `json:"uid"`
Precedence *int `json:"precedence,omitempty"`
Active *bool `json:"active,omitempty"`
Conditions *Conditions `json:"conditions,omitempty"`
Actions *Actions `json:"actions,omitempty"`
}
SearchRequestInlineRule is a search rule sent with a query to preview its effect without saving it.
type SearchRequestPersonalize ΒΆ added in v0.37.0
type SearchRequestPersonalize struct {
// UserContext is a free-text, natural-language description of the user's
// preferences, behavior, or intent (e.g. "Prefers compact mechanical keyboards
// from Keychron, mid-range budget"). The re-ranking model only processes
// positive signals, so state preferences affirmatively.
UserContext string `json:"userContext"`
}
SearchRequestPersonalize configures personalized search. When set, Meilisearch re-ranks results based on the user profile described in UserContext.
Requires the experimental search personalization feature to be enabled on the server. Documentation: https://www.meilisearch.com/docs/capabilities/personalization/getting_started/personalized_search
type SearchResponse ΒΆ
type SearchResponse struct {
Hits Hits `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 json.RawMessage `json:"facetDistribution,omitempty"`
TotalHits int64 `json:"totalHits,omitempty"`
HitsPerPage int64 `json:"hitsPerPage,omitempty"`
Page int64 `json:"page,omitempty"`
TotalPages int64 `json:"totalPages,omitempty"`
FacetStats json.RawMessage `json:"facetStats,omitempty"`
IndexUID string `json:"indexUid,omitempty"`
QueryVector *[]float32 `json:"queryVector,omitempty"`
PerformanceDetails map[string]any `json:"performanceDetails,omitempty"`
Metadata *SearchMetadata `json:"metadata,omitempty"`
}
SearchResponse is the response body for search method
type SearchRule ΒΆ added in v0.36.3
type SearchRulesFilter ΒΆ added in v0.36.3
type SearchRulesManager ΒΆ added in v0.36.3
type SearchRulesManager interface {
SearchRulesReader
// UpdateSearchRule update a dynamic search rule or create a new one if it doesn't exist.
//
// docs: https://www.meilisearch.com/docs/reference/api/search-rules/create-or-update-a-search-rule
UpdateSearchRule(ctx context.Context, uid string, params *SearchRulesRequest) (*Task, error)
// DeleteSearchRule deletes a dynamic search rule by its unique identifier.
// If uid is nil, all dynamic search rules will be deleted.
//
// docs: https://www.meilisearch.com/docs/reference/api/dynamic-search-rules/delete-a-dynamic-search-rule
DeleteSearchRule(ctx context.Context, uid *string) (*Task, error)
}
type SearchRulesParams ΒΆ added in v0.36.3
type SearchRulesParams struct {
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
Filter *SearchRulesFilter `json:"filter,omitempty"`
}
type SearchRulesReader ΒΆ added in v0.36.3
type SearchRulesReader interface {
// ListSearchRules returns all dynamic search rules configured on the instance.
//
// docs: https://www.meilisearch.com/docs/reference/api/dynamic-search-rules/list-dynamic-search-rules
ListSearchRules(ctx context.Context, params *SearchRulesParams) (*SearchRulesResults, error)
// GetSearchRule retrieve a single dynamic search rule by its unique identifier.
//
// docs: https://www.meilisearch.com/docs/reference/api/dynamic-search-rules/get-a-dynamic-search-rule
GetSearchRule(ctx context.Context, uid string) (*SearchRule, error)
}
type SearchRulesRequest ΒΆ added in v0.36.3
type SearchRulesRequest struct {
Description string `json:"description,omitempty"`
Precedence *int `json:"precedence,omitempty"`
Active *bool `json:"active,omitempty"`
Conditions *Conditions `json:"conditions,omitempty"`
Actions *Actions `json:"actions,omitempty"`
}
type SearchRulesResults ΒΆ added in v0.36.3
type SearchRulesResults struct {
Results []SearchRule `json:"results"`
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
Total int64 `json:"total"`
}
type ServiceManager ΒΆ added in v0.28.0
type ServiceManager interface {
ServiceReader
KeyManager
TaskManager
ChatManager
ChatReader
WebhookManager
SearchRulesManager
ServiceReader() ServiceReader
TaskManager() TaskManager
TaskReader() TaskReader
KeyManager() KeyManager
KeyReader() KeyReader
SearchRulesManager() SearchRulesManager
SearchRulesReader() SearchRulesReader
ChatManager() ChatManager
ChatReader() ChatReader
WebhookManager() WebhookManager
WebhookReader() WebhookReader
// CreateIndex creates a new index.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/create-index
CreateIndex(ctx context.Context, config *IndexConfig) (*TaskInfo, error)
// DeleteIndex deletes a specific index.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/delete-index
DeleteIndex(ctx context.Context, uid string) (*TaskInfo, error)
// SwapIndexes swaps two existing indexes if rename is false; use rename: true if the second index does not exist.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/swap-indexes
SwapIndexes(ctx context.Context, param []*SwapIndexesParams) (*TaskInfo, error)
// GenerateTenantToken generates a tenant token for multi-tenancy.
GenerateTenantToken(apiKeyUID string, searchRules map[string]interface{}, options *TenantTokenOptions) (string, error)
// CreateDump creates a database dump.
//
// docs: https://www.meilisearch.com/docs/reference/api/backups/create-dump
CreateDump(ctx context.Context) (*TaskInfo, error)
// CreateSnapshot create database snapshot from meilisearch
//
// docs: https://www.meilisearch.com/docs/reference/api/backups/create-snapshot
CreateSnapshot(ctx context.Context) (*TaskInfo, error)
// ExperimentalFeatures returns the experimental features manager.
ExperimentalFeatures() *ExperimentalFeatures
// Export transfers data from your origin instance to a remote target instance.
//
// docs: https://www.meilisearch.com/docs/reference/api/export/export-to-a-remote-meilisearch
Export(ctx context.Context, params *ExportParams) (*TaskInfo, error)
// Experimental: UpdateNetwork updates the network object.
//
// - If leader is set to a value then UpdateNetwork will return a *[Task] object.
// - If leader is not set or explicitly set to null it will return a *[Network] object.
// - Updates are partial; only the provided fields are updated.
//
// docs: https://www.meilisearch.com/docs/reference/api/experimental-features/configure-network-topology
UpdateNetwork(ctx context.Context, params *UpdateNetworkRequest) (any, error)
// RenderTemplate renders any template or fragment on any input
//
// docs: https://www.meilisearch.com/docs/reference/api/template/render-documents-with-post
RenderTemplate(ctx context.Context, params *RenderTemplateParams) (*RenderTemplateResponse, error)
// 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(context.Background())
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(context.Background(), documents, nil)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(task.TaskUID)
type ServiceReader ΒΆ added in v0.30.0
type ServiceReader interface {
// Index retrieves an IndexManager for a specific index.
Index(uid string) IndexManager
// GetIndex fetches the details of a specific index and returns a *[IndexResult] object.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/get-index
GetIndex(ctx context.Context, indexID string) (*IndexResult, error)
// GetRawIndex fetches the raw JSON representation of a specific index and returns it as a map
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/get-index
GetRawIndex(ctx context.Context, uid string) (map[string]interface{}, error)
// ListIndexes lists all indexes.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/list-indexes
ListIndexes(ctx context.Context, param *IndexesQuery) (*IndexesResults, error)
// GetRawIndexes fetches the raw JSON representation of all indexes.
//
// docs: https://www.meilisearch.com/docs/reference/api/indexes/list-indexes
GetRawIndexes(ctx context.Context, param *IndexesQuery) (map[string]interface{}, error)
// MultiSearch performs a multi-index search.
//
// docs: https://www.meilisearch.com/docs/reference/api/search/perform-a-multi-search
MultiSearch(ctx context.Context, queries *MultiSearchRequest) (*MultiSearchResponse, error)
// GetStats fetches global stats.
//
// docs: https://www.meilisearch.com/docs/reference/api/stats/get-stats-of-all-indexes
GetStats(ctx context.Context, param *StatsParams) (*Stats, error)
// Version fetches the version of the Meilisearch server.
//
// docs: https://www.meilisearch.com/docs/reference/api/version/get-version
Version(ctx context.Context) (*Version, error)
// Health checks the health of the Meilisearch server.
//
// docs: https://www.meilisearch.com/docs/reference/api/health/get-health
Health(ctx context.Context) (*Health, error)
// IsHealthy checks if the Meilisearch server is healthy.
IsHealthy() bool
// GetBatches allows you to monitor how Meilisearch is grouping and processing asynchronous operations.
//
// docs: https://www.meilisearch.com/docs/reference/api/async-task-management/list-batches
GetBatches(ctx context.Context, param *BatchesQuery) (*BatchesResults, error)
// GetBatch retrieves a specific batch by its UID.
//
// docs: https://www.meilisearch.com/docs/reference/api/async-task-management/get-batch
GetBatch(ctx context.Context, batchUID int) (*Batch, error)
// Experimental: GetNetwork gets the current value of the instanceβs network object.
//
// docs: https://www.meilisearch.com/docs/reference/api/experimental-features/get-network-topology#get-network-topology
GetNetwork(ctx context.Context) (*Network, error)
}
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"`
PrefixSearch *string `json:"prefixSearch,omitempty"`
FacetSearch bool `json:"facetSearch,omitempty"`
Chat *Chat `json:"chat,omitempty"`
ForeignKeys []ForeignKey `json:"foreignKeys,omitempty"`
}
Settings is the type that represents the settings in meilisearch
type SettingsManager ΒΆ added in v0.30.0
type SettingsManager interface {
SettingsReader
// UpdateSettings updates the settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-all-settings
UpdateSettings(ctx context.Context, request *Settings) (*TaskInfo, error)
// ResetSettings resets the settings of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-all-settings
ResetSettings(ctx context.Context) (*TaskInfo, error)
// UpdateRankingRules updates the ranking rules of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-rankingrules
UpdateRankingRules(ctx context.Context, request *[]string) (*TaskInfo, error)
// ResetRankingRules resets the ranking rules of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-rankingrules
ResetRankingRules(ctx context.Context) (*TaskInfo, error)
// UpdateDistinctAttribute updates the distinct attribute of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-distinctattribute
UpdateDistinctAttribute(ctx context.Context, request string) (*TaskInfo, error)
// ResetDistinctAttribute resets the distinct attribute of the index to default value.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-distinctattribute
ResetDistinctAttribute(ctx context.Context) (*TaskInfo, error)
// UpdateSearchableAttributes updates the searchable attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-searchableattributes
UpdateSearchableAttributes(ctx context.Context, request *[]string) (*TaskInfo, error)
// ResetSearchableAttributes resets the searchable attributes of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-searchableattributes
ResetSearchableAttributes(ctx context.Context) (*TaskInfo, error)
// UpdateDisplayedAttributes updates the displayed attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-displayedattributes
UpdateDisplayedAttributes(ctx context.Context, request *[]string) (*TaskInfo, error)
// ResetDisplayedAttributes resets the displayed attributes of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-displayedattributes
ResetDisplayedAttributes(ctx context.Context) (*TaskInfo, error)
// UpdateStopWords updates the stop words of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-stopwords
UpdateStopWords(ctx context.Context, request *[]string) (*TaskInfo, error)
// ResetStopWords resets the stop words of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-stopwords
ResetStopWords(ctx context.Context) (*TaskInfo, error)
// UpdateSynonyms updates the synonyms of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-synonyms
UpdateSynonyms(ctx context.Context, request *map[string][]string) (*TaskInfo, error)
// ResetSynonyms resets the synonyms of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-synonyms
ResetSynonyms(ctx context.Context) (*TaskInfo, error)
// UpdateFilterableAttributes updates the filterable attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-filterableattributes
UpdateFilterableAttributes(ctx context.Context, request *[]interface{}) (*TaskInfo, error)
// ResetFilterableAttributes resets the filterable attributes of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-filterableattributes
ResetFilterableAttributes(ctx context.Context) (*TaskInfo, error)
// UpdateSortableAttributes updates the sortable attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-sortableattributes
UpdateSortableAttributes(ctx context.Context, request *[]string) (*TaskInfo, error)
// ResetSortableAttributes resets the sortable attributes of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-sortableattributes
ResetSortableAttributes(ctx context.Context) (*TaskInfo, error)
// UpdateTypoTolerance updates the typo tolerance settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-typotolerance
UpdateTypoTolerance(ctx context.Context, request *TypoTolerance) (*TaskInfo, error)
// ResetTypoTolerance resets the typo tolerance settings of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-typotolerance
ResetTypoTolerance(ctx context.Context) (*TaskInfo, error)
// UpdatePagination updates the pagination settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-pagination
UpdatePagination(ctx context.Context, request *Pagination) (*TaskInfo, error)
// ResetPagination resets the pagination settings of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-pagination
ResetPagination(ctx context.Context) (*TaskInfo, error)
// UpdateFaceting updates the faceting settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-faceting
UpdateFaceting(ctx context.Context, request *Faceting) (*TaskInfo, error)
// ResetFaceting resets the faceting settings of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-faceting
ResetFaceting(ctx context.Context) (*TaskInfo, error)
// UpdateEmbedders updates the embedders of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-embedders
UpdateEmbedders(ctx context.Context, request map[string]Embedder) (*TaskInfo, error)
// ResetEmbedders resets the embedders of the index to default values.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-embedders
ResetEmbedders(ctx context.Context) (*TaskInfo, error)
// UpdateSearchCutoffMs updates the search cutoff time in milliseconds.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-searchcutoffms
UpdateSearchCutoffMs(ctx context.Context, request int64) (*TaskInfo, error)
// ResetSearchCutoffMs resets the search cutoff time in milliseconds to default value.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-searchcutoffms
ResetSearchCutoffMs(ctx context.Context) (*TaskInfo, error)
// UpdateSeparatorTokens update separator tokens
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-separatortokens
UpdateSeparatorTokens(ctx context.Context, tokens []string) (*TaskInfo, error)
// ResetSeparatorTokens reset separator tokens
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-separatortokens
ResetSeparatorTokens(ctx context.Context) (*TaskInfo, error)
// UpdateNonSeparatorTokens update non-separator tokens
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-nonseparatortokens
UpdateNonSeparatorTokens(ctx context.Context, tokens []string) (*TaskInfo, error)
// ResetNonSeparatorTokens reset non-separator tokens
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-nonseparatortokens
ResetNonSeparatorTokens(ctx context.Context) (*TaskInfo, error)
// UpdateDictionary update user dictionary
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-dictionary
UpdateDictionary(ctx context.Context, words []string) (*TaskInfo, error)
// ResetDictionary reset user dictionary
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-dictionary
ResetDictionary(ctx context.Context) (*TaskInfo, error)
// UpdateProximityPrecision set ProximityPrecision value ByWord or ByAttribute
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-proximityprecision
UpdateProximityPrecision(ctx context.Context, proximityType ProximityPrecisionType) (*TaskInfo, error)
// ResetProximityPrecision reset ProximityPrecision to default ByWord
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-proximityprecision
ResetProximityPrecision(ctx context.Context) (*TaskInfo, error)
// UpdateLocalizedAttributes update the localized attributes settings of an index
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-localizedattributes
UpdateLocalizedAttributes(ctx context.Context, request []*LocalizedAttributes) (*TaskInfo, error)
// ResetLocalizedAttributes reset the localized attributes settings
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-localizedattributes
ResetLocalizedAttributes(ctx context.Context) (*TaskInfo, error)
// UpdatePrefixSearch updates the prefix search setting of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-prefixsearch
UpdatePrefixSearch(ctx context.Context, request string) (*TaskInfo, error)
// ResetPrefixSearch resets the prefix search setting of the index to default value.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-prefixsearch
ResetPrefixSearch(ctx context.Context) (*TaskInfo, error)
// UpdateFacetSearch updates the facet search setting of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-facetsearch
UpdateFacetSearch(ctx context.Context, request bool) (*TaskInfo, error)
// ResetFacetSearch resets the facet search setting of the index to default value.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-facetsearch
ResetFacetSearch(ctx context.Context) (*TaskInfo, error)
// UpdateForeignKeys updates the foreignKeys setting for the index. Set foreignKeys to nil to reset to default.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/update-foreignkeys
UpdateForeignKeys(ctx context.Context, foreignKeys []ForeignKey) (*TaskInfo, error)
// ResetForeignKeys resets the foreignKeys setting to its default value.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/reset-foreignkeys
ResetForeignKeys(ctx context.Context) (*TaskInfo, error)
}
type SettingsReader ΒΆ added in v0.30.0
type SettingsReader interface {
// GetSettings retrieves the settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/list-all-settings
GetSettings(ctx context.Context) (*Settings, error)
// GetRankingRules retrieves the ranking rules of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-rankingrules
GetRankingRules(ctx context.Context) (*[]string, error)
// GetDistinctAttribute retrieves the distinct attribute of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-distinctattribute
GetDistinctAttribute(ctx context.Context) (*string, error)
// GetSearchableAttributes retrieves the searchable attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-searchableattributes
GetSearchableAttributes(ctx context.Context) (*[]string, error)
// GetDisplayedAttributes retrieves the displayed attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-displayedattributes
GetDisplayedAttributes(ctx context.Context) (*[]string, error)
// GetStopWords retrieves the stop words of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-stopwords
GetStopWords(ctx context.Context) (*[]string, error)
// GetSynonyms retrieves the synonyms of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-synonyms
GetSynonyms(ctx context.Context) (*map[string][]string, error)
// GetFilterableAttributes retrieves the filterable attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-filterableattributes
GetFilterableAttributes(ctx context.Context) (*[]interface{}, error)
// GetSortableAttributes retrieves the sortable attributes of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-sortableattributes
GetSortableAttributes(ctx context.Context) (*[]string, error)
// GetTypoTolerance retrieves the typo tolerance settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-typotolerance
GetTypoTolerance(ctx context.Context) (*TypoTolerance, error)
// GetPagination retrieves the pagination settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-pagination
GetPagination(ctx context.Context) (*Pagination, error)
// GetFaceting retrieves the faceting settings of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-faceting
GetFaceting(ctx context.Context) (*Faceting, error)
// GetEmbedders retrieves the embedders of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-embedders
GetEmbedders(ctx context.Context) (map[string]Embedder, error)
// GetSearchCutoffMs retrieves the search cutoff time in milliseconds.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-searchcutoffms
GetSearchCutoffMs(ctx context.Context) (int64, error)
// GetSeparatorTokens returns separators tokens
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-separatortokens
GetSeparatorTokens(ctx context.Context) ([]string, error)
// GetNonSeparatorTokens returns non-separator tokens
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-nonseparatortokens
GetNonSeparatorTokens(ctx context.Context) ([]string, error)
// GetDictionary returns user dictionary
//
//Allows users to instruct Meilisearch to consider groups of strings as a
//single term by adding a supplementary dictionary of user-defined terms.
//This is particularly useful when working with datasets containing many domain-specific
//words, and in languages where words are not separated by whitespace such as Japanese.
//Custom dictionaries are also useful in a few use-cases for space-separated languages,
//such as datasets with names such as "J. R. R. Tolkien" and "W. E. B. Du Bois".
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-dictionary
GetDictionary(ctx context.Context) ([]string, error)
// GetProximityPrecision returns ProximityPrecision configuration value
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-proximityprecision
GetProximityPrecision(ctx context.Context) (ProximityPrecisionType, error)
// GetLocalizedAttributes get the localized attributes settings of an index
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-localizedattributes
GetLocalizedAttributes(ctx context.Context) ([]*LocalizedAttributes, error)
// GetPrefixSearch retrieves the prefix search setting of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-prefixsearch
GetPrefixSearch(ctx context.Context) (*string, error)
// GetFacetSearch retrieves the facet search setting of the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-facetsearch
GetFacetSearch(ctx context.Context) (bool, error)
// GetForeignKeys returns the current value of the foreignKeys setting for the index.
//
// docs: https://www.meilisearch.com/docs/reference/api/settings/get-foreignkeys
GetForeignKeys(ctx context.Context) ([]ForeignKey, error)
}
type Shard ΒΆ added in v0.36.2
type Shard struct {
Remotes []string `json:"remotes"`
}
Shard represents a shard in the network
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"`
ShowPerformanceDetails bool `json:"showPerformanceDetails,omitempty"`
RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
}
SimilarDocumentQuery is query parameters of similar documents
type SimilarDocumentResult ΒΆ added in v0.27.2
type SimilarDocumentResult struct {
Hits Hits `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"`
PerformanceDetails map[string]any `json:"performanceDetails,omitempty"`
}
type SortFacetType ΒΆ added in v0.28.0
type SortFacetType string // SortFacetType is type of facet sorting, alpha, count or sampledCount
const ( SortFacetTypeAlpha SortFacetType = "alpha" SortFacetTypeCount SortFacetType = "count" // SortFacetTypeSampledCount sorts facet values by an approximate count // computed on a sample of the documents (Meilisearch v1.56+). SortFacetTypeSampledCount SortFacetType = "sampledCount" )
type Stats ΒΆ
type Stats struct {
DatabaseSize any `json:"databaseSize"`
UsedDatabaseSize any `json:"usedDatabaseSize"`
LastUpdate time.Time `json:"lastUpdate"`
Indexes map[string]StatsIndex `json:"indexes"`
}
Stats is the type that represent all stats
type StatsIndex ΒΆ added in v0.9.1
type StatsIndex struct {
NumberOfDocuments int64 `json:"numberOfDocuments"`
IsIndexing bool `json:"isIndexing"`
FieldDistribution map[string]int64 `json:"fieldDistribution"`
IndexSize any `json:"indexSize"`
UsedIndexSize any `json:"usedIndexSize"`
RawDocumentDbSize any `json:"rawDocumentDbSize"`
AvgDocumentSize any `json:"avgDocumentSize"`
NumberOfEmbeddedDocuments int64 `json:"numberOfEmbeddedDocuments"`
NumberOfEmbeddings int64 `json:"numberOfEmbeddings"`
InternalDatabaseSizes map[string]any `json:"internalDatabaseSizes"`
}
StatsIndex is the type that represent the stats of an index in meilisearch
type StatsParams ΒΆ added in v0.36.3
type Stream ΒΆ added in v0.33.1
type Stream[T any] struct { // contains filtered or unexported fields }
type SwapIndexesParams ΒΆ added in v0.22.0
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"`
TaskNetwork TaskNetwork `json:"network,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"`
CustomMetadata string `json:"customMetadata,omitempty"`
}
Task indicates information about a task resource
Documentation: https://www.meilisearch.com/docs/learn/advanced/asynchronous_operations
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
type TaskManager ΒΆ added in v0.30.0
type TaskManager interface {
TaskReader
// CancelTasks cancels specific tasks.
//
// docs: https://www.meilisearch.com/docs/reference/api/async-task-management/cancel-tasks
CancelTasks(ctx context.Context, param *CancelTasksQuery) (*TaskInfo, error)
// DeleteTasks deletes specific tasks.
//
// docs: https://www.meilisearch.com/docs/reference/api/async-task-management/delete-tasks
DeleteTasks(ctx context.Context, param *DeleteTasksQuery) (*TaskInfo, error)
// GetTaskDocuments retrieves the documents associated with a task (added, updated, or deleted).
// dst must be a non-nil pointer to a slice that receives the streamed NDJSON documents.
//
// docs: https://www.meilisearch.com/docs/reference/api/async-task-management/get-tasks-documents
GetTaskDocuments(ctx context.Context, taskUID int64, dst interface{}) error
}
type TaskNetwork ΒΆ added in v0.33.3
type TaskNetwork struct {
Origin *Origin `json:"origin,omitempty"`
RemoteTasks map[string]*TaskRemote `json:"remote_tasks,omitempty"`
NetworkVersion string `json:"network_version,omitempty"`
ImportFrom *ImportFrom `json:"import_from,omitempty"`
NetworkChange *Origin `json:"network_change,omitempty"`
}
TaskNetwork indicates information about a task network
Documentation: https://www.meilisearch.com/docs/reference/api/async-task-management/get-task#response-network
type TaskReader ΒΆ added in v0.30.0
type TaskReader interface {
// GetTask retrieves a task by its UID.
//
// docs: https://www.meilisearch.com/docs/reference/api/async-task-management/get-task
GetTask(ctx context.Context, taskUID int64) (*Task, error)
// GetTasks retrieves multiple tasks based on query parameters.
//
// docs: https://www.meilisearch.com/docs/reference/api/async-task-management/list-tasks
GetTasks(ctx context.Context, param *TasksQuery) (*TaskResult, error)
// WaitForTask waits for a task to complete by its UID with the given interval.
WaitForTask(ctx context.Context, taskUID int64, interval time.Duration) (*Task, error)
}
type TaskRemote ΒΆ added in v0.33.3
type TaskRemote struct {
TaskUID *int64 `json:"taskUid,omitempty"`
Error *APIErrorDetails `json:"error,omitempty"`
}
TaskRemote is the result of replicating a task to a remote: the uid of the task created on the remote, or the error that prevented it.
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
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" // TaskTypeExport represents a task exportation TaskTypeExport TaskType = "export" )
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
Reverse bool
}
TasksQuery is a list of filter available to send as query parameters
type TempelateInput ΒΆ added in v0.37.0
type TemplateKind ΒΆ added in v0.37.0
type TemplateKind string
const ( DocumentTemplate TemplateKind = "documentTemplate" ChatDocumentTemplate TemplateKind = "chatDocumentTemplate" IndexingFragment TemplateKind = "indexingFragment" SearchFragment TemplateKind = "searchFragment" InlineDocumentTemplate TemplateKind = "inlineDocumentTemplate" InlineFragment TemplateKind = "inlineFragment" )
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
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.
type TimeCondition ΒΆ added in v0.37.0
type Timestampz ΒΆ added in v0.33.1
type Timestampz int64
func (Timestampz) String ΒΆ added in v0.33.1
func (t Timestampz) String() string
func (Timestampz) ToTime ΒΆ added in v0.33.1
func (t Timestampz) ToTime() time.Time
type TypoTolerance ΒΆ added in v0.19.1
type TypoTolerance struct {
Enabled bool `json:"enabled"`
MinWordSizeForTypos MinWordSizeForTypos `json:"minWordSizeForTypos"`
DisableOnWords []string `json:"disableOnWords"`
DisableOnAttributes []string `json:"disableOnAttributes"`
DisableOnNumbers bool `json:"disableOnNumbers"`
}
TypoTolerance is the type that represents the typo tolerance setting in meilisearch
type UpdateDocumentByFunctionRequest ΒΆ added in v0.30.0
type UpdateDocumentByFunctionRequest struct {
Filter string `json:"filter,omitempty"`
Function string `json:"function"`
Context map[string]interface{} `json:"context,omitempty"`
// TaskCustomMetadata is the custom metadata to add to the task.
// This string will be associated with the task and visible in the task details.
// It is optional.
TaskCustomMetadata string `json:"-"`
}
type UpdateIndexRequestParams ΒΆ added in v0.34.0
type UpdateIndexRequestParams struct {
PrimaryKey string `json:"primaryKey,omitempty"`
UID string `json:"uid,omitempty"`
}
UpdateIndexRequestParams is the request body for update Index primary key and renaming IndexUid
type UpdateNetworkRequest ΒΆ added in v0.35.0
type UpdateNetworkRequest struct {
Self Opt[string] `json:"self,omitempty"`
Leader Opt[string] `json:"leader,omitempty"`
Remotes Opt[map[string]Opt[UpdateRemote]] `json:"remotes,omitempty"`
Shards Opt[map[string]Opt[UpdateRemoteShard]] `json:"shards,omitempty"` // FIXED
Version Opt[string] `json:"version,omitempty"`
}
UpdateNetworkRequest represents the Meilisearch network configuration update without leader. Each field is wrapped in an Opt so it can be explicitly included, set to JSON null, or omitted entirely.
func (UpdateNetworkRequest) MarshalJSON ΒΆ added in v0.35.0
func (n UpdateNetworkRequest) MarshalJSON() ([]byte, error)
type UpdateRemote ΒΆ added in v0.35.0
type UpdateRemote struct {
URL Opt[string] `json:"url"`
SearchAPIKey Opt[string] `json:"searchApiKey,omitempty"`
WriteAPIKey Opt[string] `json:"writeApiKey,omitempty"`
}
UpdateRemote describes a single remote Meilisearch node. Each field is wrapped in an Opt so it can be explicitly included, set to JSON null, or omitted entirely.
func (UpdateRemote) MarshalJSON ΒΆ added in v0.35.0
func (r UpdateRemote) MarshalJSON() ([]byte, error)
type UpdateRemoteShard ΒΆ added in v0.36.2
type UpdateRemoteShard struct {
Remotes Opt[[]string] `json:"remotes,omitempty"`
AddRemotes Opt[[]string] `json:"addRemotes,omitempty"`
RemoveRemotes Opt[[]string] `json:"removeRemotes,omitempty"`
}
UpdateRemoteShard represents a shard update request
func (UpdateRemoteShard) MarshalJSON ΒΆ added in v0.36.2
func (u UpdateRemoteShard) MarshalJSON() ([]byte, error)
type UpdateWebhookRequest ΒΆ added in v0.33.1
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
type WebhookManager ΒΆ added in v0.33.1
type WebhookManager interface {
WebhookReader
// AddWebhook add a new webhook to meilisearch.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/create-webhook
AddWebhook(ctx context.Context, params *AddWebhookRequest) (*Webhook, error)
// UpdateWebhook modifies a previously existing webhook.
// If the webhook has isEditable to false the HTTP call returns an error.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/update-webhook
UpdateWebhook(ctx context.Context, uuid string, params *UpdateWebhookRequest) (*Webhook, error)
// DeleteWebhook deletes an existing webhook. Will also fail when the webhook doesnβt exist.
// If the webhook has isEditable to false the HTTP call returns an error.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/delete-webhook
DeleteWebhook(ctx context.Context, uuid string) error
}
type WebhookReader ΒΆ added in v0.33.1
type WebhookReader interface {
// ListWebhooks lists all the webhooks.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/list-webhooks
ListWebhooks(ctx context.Context) (*WebhookResults, error)
// GetWebhook gets a webhook by uuid.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/get-webhook
GetWebhook(ctx context.Context, uuid string) (*Webhook, error)
}
type WebhookResults ΒΆ added in v0.33.1
type WebhookResults struct {
Result []*Webhook `json:"results"`
}
Source Files
ΒΆ
- chat.go
- chat_interface.go
- client.go
- doc.go
- encoding.go
- enum.go
- error.go
- features.go
- field.go
- helper.go
- hit.go
- index.go
- index_document.go
- index_interface.go
- index_search.go
- index_settings.go
- index_task.go
- meilisearch.go
- meilisearch_interface.go
- models_chat.go
- models_documents.go
- models_indexes.go
- models_keys.go
- models_networks.go
- models_search.go
- models_settings.go
- models_tasks.go
- models_webhooks.go
- networks.go
- options.go
- pool.go
- search_request_builder.go
- search_rules.go
- search_rules_interface.go
- stream.go
- task_documents.go
- types.go
- version.go
- webhooks.go
- webhooks_interface.go
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
examples
|
|
|
add_documents
command
|
|
|
chat_stream
command
|
|
|
create_index_settings
command
|
|
|
facet_search
command
|
|
|
manage_tasks
command
|
|
|
multi_search
command
|
|
|
search
command
|
|