Skip to content

Commit

Permalink
Add support for stopwords, metrics & stats (#179)
Browse files Browse the repository at this point in the history
* feat: retrieve & upsert stopwords

* feat: retrieve & delete a stopword set

* test-integration: retrieve & upsert stopwords sets

* test-integration: retrieve & delete a stopword set

* test-integration: single collection & multi search with stopwords

* fix: multi-search integration test

* feat: retrieve API stats

* fix: lint

* feat: retrieve cluster metrics

* fix: bump to v2 after git rebase

* update README: stopwords, metrics & stats
  • Loading branch information
phiHero authored Jul 24, 2024
1 parent 6c6045c commit ee84717
Show file tree
Hide file tree
Showing 23 changed files with 1,262 additions and 15 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,34 @@ client.Collection("products").Synonyms().Retrieve(context.Background())
client.Collection("products").Synonym("coat-synonyms").Delete(context.Background())
```

### Create or update a stopwords set

```go
stopwords := &api.StopwordsSetUpsertSchema{
Locale: pointer.String("en"),
Stopwords: []string{"Germany", "France", "Italy", "United States"},
}
client.Stopwords().Upsert(context.Background(), "stopword_set1", stopwords)
```

### Retrieve a stopwords set

```go
client.Stopword("stopword_set1").Retrieve(context.Background())
```

### List all stopwords sets

```go
client.Stopwords().Retrieve(context.Background())
```

### Delete a stopwords set

```go
client.Stopword("stopword_set1").Delete(context.Background())
```

### Create or update a preset

```go
Expand Down Expand Up @@ -445,6 +473,18 @@ client.Operations().Snapshot(context.Background(), "/tmp/typesense-data-snapshot
client.Operations().Vote(context.Background())
```

### Cluster Metrics

```go
client.Metrics().Retrieve(context.Background())
```

### API Stats

```go
client.Stats().Retrieve(context.Background())
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/typesense/typesense-go.
Expand Down
208 changes: 206 additions & 2 deletions typesense/api/client_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ee84717

Please sign in to comment.