mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -4,93 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/search/api](ht
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Search
|
||||
|
||||
Search for documents in a given in index
|
||||
|
||||
|
||||
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/search"
|
||||
)
|
||||
|
||||
// Search for documents in a given in index
|
||||
func SearchForAdocument() {
|
||||
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := searchService.Search(&search.SearchRequest{
|
||||
Index: "customers",
|
||||
Query: "name == 'John'",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
## Search
|
||||
|
||||
Search for documents in a given in index
|
||||
|
||||
|
||||
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/search"
|
||||
)
|
||||
|
||||
// Search for documents in a given in index
|
||||
func SearchOnMultipleFieldsand() {
|
||||
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := searchService.Search(&search.SearchRequest{
|
||||
Index: "customers",
|
||||
Query: "name == 'John' AND starsign == 'Leo'",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
## Search
|
||||
|
||||
Search for documents in a given in index
|
||||
|
||||
|
||||
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/search"
|
||||
)
|
||||
|
||||
// Search for documents in a given in index
|
||||
func SearchOnMultipleFieldsor() {
|
||||
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := searchService.Search(&search.SearchRequest{
|
||||
Index: "customers",
|
||||
Query: "name == 'John' OR name == 'Jane'",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
## Delete
|
||||
|
||||
Delete a document given its ID
|
||||
@@ -212,3 +125,90 @@ Index: "customers",
|
||||
|
||||
}
|
||||
```
|
||||
## Search
|
||||
|
||||
Search for documents in a given in index
|
||||
|
||||
|
||||
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/search"
|
||||
)
|
||||
|
||||
// Search for documents in a given in index
|
||||
func SearchForAdocument() {
|
||||
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := searchService.Search(&search.SearchRequest{
|
||||
Index: "customers",
|
||||
Query: "name == 'John'",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
## Search
|
||||
|
||||
Search for documents in a given in index
|
||||
|
||||
|
||||
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/search"
|
||||
)
|
||||
|
||||
// Search for documents in a given in index
|
||||
func SearchOnMultipleFieldsand() {
|
||||
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := searchService.Search(&search.SearchRequest{
|
||||
Index: "customers",
|
||||
Query: "name == 'John' AND starsign == 'Leo'",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
## Search
|
||||
|
||||
Search for documents in a given in index
|
||||
|
||||
|
||||
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/search"
|
||||
)
|
||||
|
||||
// Search for documents in a given in index
|
||||
func SearchOnMultipleFieldsor() {
|
||||
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := searchService.Search(&search.SearchRequest{
|
||||
Index: "customers",
|
||||
Query: "name == 'John' OR name == 'Jane'",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user