31 KiB
\IndexAPI
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| DeleteIndexIndexesByUid | Delete /v1/index/indexes/{uid} | Deletes an index and everything in it. |
| DeleteIndexIndexesByUidDocumentsById | Delete /v1/index/indexes/{uid}/documents/{id} | Deletes one document by its primary key. |
| GetIndexHealth | Get /v1/index/health | Reports whether the search plane can serve. |
| GetIndexIndexes | Get /v1/index/indexes | Lists the indexes your org holds. |
| GetIndexIndexesByUid | Get /v1/index/indexes/{uid} | Reads one index's definition. |
| GetIndexIndexesByUidDocuments | Get /v1/index/indexes/{uid}/documents | Pages through the documents in an index. |
| GetIndexIndexesByUidDocumentsById | Get /v1/index/indexes/{uid}/documents/{id} | Reads one document by its primary key. |
| GetIndexIndexesByUidSettings | Get /v1/index/indexes/{uid}/settings | Reads an index's filterable attributes. |
| GetIndexStats | Get /v1/index/stats | Counts the documents in each of your indexes. |
| GetIndexTasksByUid | Get /v1/index/tasks/{uid} | Checks a write task, which has already finished. |
| GetIndexVersion | Get /v1/index/version | Identifies the search implementation answering. |
| PatchIndexIndexesByUidSettings | Patch /v1/index/indexes/{uid}/settings | Sets which attributes an index can be filtered on. |
| PostIndexIndexes | Post /v1/index/indexes | Creates an index. |
| PostIndexIndexesByUidDocuments | Post /v1/index/indexes/{uid}/documents | Add or replace documents in an index |
| PostIndexIndexesByUidDocumentsDeleteBatch | Post /v1/index/indexes/{uid}/documents/delete-batch | Delete many documents by primary key in one call |
| PostIndexIndexesByUidSearch | Post /v1/index/indexes/{uid}/search | Searches an index, forgiving typos. |
| PutIndexIndexesByUidDocuments | Put /v1/index/indexes/{uid}/documents | Add or update documents in an index |
DeleteIndexIndexesByUid
IndexIndexEnqueued DeleteIndexIndexesByUid(ctx, uid).Execute()
Deletes an index and everything in it.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.DeleteIndexIndexesByUid(context.Background(), uid).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.DeleteIndexIndexesByUid``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteIndexIndexesByUid`: IndexIndexEnqueued
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.DeleteIndexIndexesByUid`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiDeleteIndexIndexesByUidRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteIndexIndexesByUidDocumentsById
IndexIndexEnqueued DeleteIndexIndexesByUidDocumentsById(ctx, uid, id).Execute()
Deletes one document by its primary key.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
id := "id_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.DeleteIndexIndexesByUidDocumentsById(context.Background(), uid, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.DeleteIndexIndexesByUidDocumentsById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteIndexIndexesByUidDocumentsById`: IndexIndexEnqueued
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.DeleteIndexIndexesByUidDocumentsById`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string | ||
| id | string |
Other Parameters
Other parameters are passed through a pointer to a apiDeleteIndexIndexesByUidDocumentsByIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexHealth
IndexIndexHealth GetIndexHealth(ctx).Execute()
Reports whether the search plane can serve.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexHealth(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexHealth``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexHealth`: IndexIndexHealth
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexHealth`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexHealthRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexIndexes
IndexIndexList GetIndexIndexes(ctx).Execute()
Lists the indexes your org holds.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexIndexes(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexIndexes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexIndexes`: IndexIndexList
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexIndexes`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexIndexesRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexIndexesByUid
IndexIndexView GetIndexIndexesByUid(ctx, uid).Execute()
Reads one index's definition.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexIndexesByUid(context.Background(), uid).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexIndexesByUid``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexIndexesByUid`: IndexIndexView
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexIndexesByUid`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexIndexesByUidRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexIndexesByUidDocuments
IndexIndexDocuments GetIndexIndexesByUidDocuments(ctx, uid).Limit(limit).Offset(offset).Execute()
Pages through the documents in an index.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
limit := "limit_example" // string | (optional)
offset := "offset_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexIndexesByUidDocuments(context.Background(), uid).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexIndexesByUidDocuments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexIndexesByUidDocuments`: IndexIndexDocuments
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexIndexesByUidDocuments`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexIndexesByUidDocumentsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
limit | string | | offset | string | |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexIndexesByUidDocumentsById
interface{} GetIndexIndexesByUidDocumentsById(ctx, uid, id).Execute()
Reads one document by its primary key.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
id := "id_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexIndexesByUidDocumentsById(context.Background(), uid, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexIndexesByUidDocumentsById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexIndexesByUidDocumentsById`: interface{}
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexIndexesByUidDocumentsById`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string | ||
| id | string |
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexIndexesByUidDocumentsByIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
interface{}
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexIndexesByUidSettings
IndexIndexSettings GetIndexIndexesByUidSettings(ctx, uid).Execute()
Reads an index's filterable attributes.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexIndexesByUidSettings(context.Background(), uid).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexIndexesByUidSettings``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexIndexesByUidSettings`: IndexIndexSettings
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexIndexesByUidSettings`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexIndexesByUidSettingsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexStats
IndexIndexStats GetIndexStats(ctx).Execute()
Counts the documents in each of your indexes.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexStats(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexStats``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexStats`: IndexIndexStats
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexStats`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexStatsRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexTasksByUid
IndexIndexTask GetIndexTasksByUid(ctx, uid).Execute()
Checks a write task, which has already finished.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := int64(789) // int64 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexTasksByUid(context.Background(), uid).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexTasksByUid``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexTasksByUid`: IndexIndexTask
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexTasksByUid`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | int64 |
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexTasksByUidRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIndexVersion
IndexIndexVersion GetIndexVersion(ctx).Execute()
Identifies the search implementation answering.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.GetIndexVersion(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.GetIndexVersion``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIndexVersion`: IndexIndexVersion
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.GetIndexVersion`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetIndexVersionRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PatchIndexIndexesByUidSettings
IndexIndexEnqueued PatchIndexIndexesByUidSettings(ctx, uid).IndexIndexFilter(indexIndexFilter).Execute()
Sets which attributes an index can be filtered on.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
indexIndexFilter := *openapiclient.NewIndexIndexFilter() // IndexIndexFilter |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.PatchIndexIndexesByUidSettings(context.Background(), uid).IndexIndexFilter(indexIndexFilter).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.PatchIndexIndexesByUidSettings``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PatchIndexIndexesByUidSettings`: IndexIndexEnqueued
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.PatchIndexIndexesByUidSettings`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiPatchIndexIndexesByUidSettingsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
indexIndexFilter | IndexIndexFilter | |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostIndexIndexes
IndexIndexEnqueued PostIndexIndexes(ctx).IndexIndexNew(indexIndexNew).Execute()
Creates an index.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
indexIndexNew := *openapiclient.NewIndexIndexNew() // IndexIndexNew |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.PostIndexIndexes(context.Background()).IndexIndexNew(indexIndexNew).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.PostIndexIndexes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostIndexIndexes`: IndexIndexEnqueued
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.PostIndexIndexes`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiPostIndexIndexesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| indexIndexNew | IndexIndexNew |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostIndexIndexesByUidDocuments
IndexEnqueued PostIndexIndexesByUidDocuments(ctx, uid).RequestBody(requestBody).Execute()
Add or replace documents in an index
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
requestBody := []interface{}{interface{}(123)} // []interface{} | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.PostIndexIndexesByUidDocuments(context.Background(), uid).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.PostIndexIndexesByUidDocuments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostIndexIndexesByUidDocuments`: IndexEnqueued
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.PostIndexIndexesByUidDocuments`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiPostIndexIndexesByUidDocumentsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
requestBody | []interface{} | |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostIndexIndexesByUidDocumentsDeleteBatch
IndexEnqueued PostIndexIndexesByUidDocumentsDeleteBatch(ctx, uid).RequestBody(requestBody).Execute()
Delete many documents by primary key in one call
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
requestBody := []interface{}{interface{}(123)} // []interface{} | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.PostIndexIndexesByUidDocumentsDeleteBatch(context.Background(), uid).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.PostIndexIndexesByUidDocumentsDeleteBatch``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostIndexIndexesByUidDocumentsDeleteBatch`: IndexEnqueued
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.PostIndexIndexesByUidDocumentsDeleteBatch`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiPostIndexIndexesByUidDocumentsDeleteBatchRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
requestBody | []interface{} | |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostIndexIndexesByUidSearch
IndexIndexHits PostIndexIndexesByUidSearch(ctx, uid).IndexIndexQuery(indexIndexQuery).Execute()
Searches an index, forgiving typos.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
indexIndexQuery := *openapiclient.NewIndexIndexQuery() // IndexIndexQuery |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.PostIndexIndexesByUidSearch(context.Background(), uid).IndexIndexQuery(indexIndexQuery).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.PostIndexIndexesByUidSearch``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostIndexIndexesByUidSearch`: IndexIndexHits
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.PostIndexIndexesByUidSearch`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiPostIndexIndexesByUidSearchRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
indexIndexQuery | IndexIndexQuery | |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PutIndexIndexesByUidDocuments
IndexEnqueued PutIndexIndexesByUidDocuments(ctx, uid).RequestBody(requestBody).Execute()
Add or update documents in an index
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
uid := "uid_example" // string |
requestBody := []interface{}{interface{}(123)} // []interface{} | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.IndexAPI.PutIndexIndexesByUidDocuments(context.Background(), uid).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IndexAPI.PutIndexIndexesByUidDocuments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PutIndexIndexesByUidDocuments`: IndexEnqueued
fmt.Fprintf(os.Stdout, "Response from `IndexAPI.PutIndexIndexesByUidDocuments`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uid | string |
Other Parameters
Other parameters are passed through a pointer to a apiPutIndexIndexesByUidDocumentsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
requestBody | []interface{} | |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]