Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-21 13:22:08 +00:00
parent 0638da0d21
commit 86d710f81e
30 changed files with 1274 additions and 1216 deletions

View File

@@ -0,0 +1,22 @@
package main
import (
"fmt"
"os"
"go.m3o.com/search"
)
// Index a record i.e. insert a document to search for.
func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Index(&search.IndexRequest{
Data: map[string]interface{}{
"starsign": "Leo",
"name": "John Doe",
"age": 37,
},
Index: "customers",
})
fmt.Println(rsp, err)
}