Manticorer Go client

February 16, 2026 · View on GitHub

Сlient for Manticore Search.

❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-go/tree/v1.11.0

Compatibility Table

manticoresearch-goManticore SearchGoCompatibility
devdev (latest development version)1.17.0 or newer✅ Fully Compatible
v1.11.0 or newer17.5.1 or newer1.17.0 or newer✅ Fully Compatible
v1.11.0 or newer13.2.3 to 17.5.11.17.0 or newer⚠️ Partially Compatible
v1.9.0 to v1.11.013.2.3 to 17.5.11.17.0 or newer✅ Fully Compatible
v1.9.0 to v1.11.07.0.0 to 13.2.31.17.0 or newer⚠️ Partially Compatible
v1.6.0 to v1.9.07.0.0 to 13.2.31.17.0 or newer✅ Fully Compatible
v1.6.0 to v1.9.06.2.12 to 7.0.01.17.0 or newer⚠️ Partially Compatible
v1.0.0 to v1.6.06.3.6 to 7.0.01.17.0 or newer✅ Fully Compatible
v1.0.0 to v1.6.06.2.12 to 6.3.61.17.0 or newer⚠️ Partially Compatible

Installation


go get github.com/manticoresoftware/manticoresearch-go@dev

Getting Started

go mod init main go get github.com/manticoresoftware/manticoresearch-go@dev


package main

import (
	"context"
	"fmt"
	Manticoresearch "github.com/manticoresoftware/manticoresearch-go"
)

func main() {

	// Create an instance of API client
	configuration := Manticoresearch.NewConfiguration()
	configuration.Servers[0].URL = "http://localhost:9308"
	apiClient := Manticoresearch.NewAPIClient(configuration)
	
	// Perform insert and search operations
	tableName := "products"
	indexDoc := map[string]interface{} {"title": "Crossbody Bag with Tassel"}
	indexReq := Manticoresearch.NewInsertDocumentRequest(tableName, indexDoc)
	indexReq.SetId(1)
	
	apiClient.IndexAPI.Insert(context.Background()).InsertDocumentRequest(*indexReq).Execute();
	
	searchRequest := Manticoresearch.NewSearchRequest(tableName)
	searchQuery := Manticoresearch.NewSearchQuery()
	searchQuery.QueryString = "@title Bag"
	searchRequest.Query = searchQuery
	queryHighlight := Manticoresearch.NewHighlight()
	queryHighlight.Fields =  map[string]interface{} {"title": map[string]interface{} {}}
	searchRequest.Highlight = queryHighlight      
	
	_, httpRes, _ := apiClient.SearchAPI.Search(context.Background()).SearchRequest(*searchRequest).Execute()
	fmt.Printf("%+v\n\n", httpRes)
}

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value openapi.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value openapi.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

Using proxy

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

More details on the use of HTTP_PROXY can be found here

Documentation for API Endpoints

All URIs are relative to http://127.0.0.1:9308

ClassMethodHTTP requestDescription
IndexAPIBulkPost /bulkBulk table operations
IndexAPIDeletePost /deleteDelete a document in a table
IndexAPIInsertPost /insertCreate a new document in a table
IndexAPIPartialReplacePost /{table}/_update/{id}Partially replaces a document in a table
IndexAPIReplacePost /replaceReplace new document in a table
IndexAPIUpdatePost /updateUpdate a document in a table
SearchAPIAutocompletePost /autocompletePerforms an autocomplete search on a table
SearchAPIPercolatePost /pq/{table}/searchPerform reverse search on a percolate table
SearchAPISearchPost /searchPerforms a search on a table
UtilsAPISqlPost /sqlPerform SQL requests

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime