Skip to content

Commit

Permalink
chore: add contribution message into README
Browse files Browse the repository at this point in the history
  • Loading branch information
GokselKUCUKSAHIN committed Jun 9, 2024
1 parent 5b5808b commit 9a8e2e8
Showing 1 changed file with 52 additions and 28 deletions.
80 changes: 52 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ To install the es-query-builder library, run the following command:
go get github.com/GokselKUCUKSAHIN/es-query-builder
```

### Examples

### Example
```json
{
"query": {
Expand Down Expand Up @@ -73,7 +72,35 @@ go get github.com/GokselKUCUKSAHIN/es-query-builder
}
```

With vanilla Go
### With es-query-builder

```go
query := es.NewQuery(
es.Bool().
Must(
es.Term("author", "George Orwell"),
).
MustNot(
es.Terms("genre", "Fantasy", "Science Fiction"),
es.Exists("out_of_print"),
).
Should(
es.Terms("title", "1984", "Animal Farm"),
),
).Aggs("genres_count",
es.AggTerms().
Field("genre"),
).Aggs("authors_and_genres",
es.AggTerms().
Field("author").
Aggs("genres",
es.AggTerms().
Field("genre"),
),
)
```

#### With vanilla Go

```go
query := map[string]interface{}{
Expand Down Expand Up @@ -135,31 +162,7 @@ query := map[string]interface{}{
}
```

```go
query := es.NewQuery(
es.Bool().
Must(
es.Term("author", "George Orwell"),
).
MustNot(
es.Terms("genre", "Fantasy", "Science Fiction"),
es.Exists("out_of_print"),
).
Should(
es.Terms("title", "1984", "Animal Farm"),
),
).Aggs("genres_count",
es.AggTerms().
Field("genre"),
).Aggs("authors_and_genres",
es.AggTerms().
Field("author").
Aggs("genres",
es.AggTerms().
Field("genre"),
),
)
```


# Benchmarks

Expand All @@ -185,6 +188,27 @@ You can check and run [benchmarks](./benchmarks) on your machine.

![arm64](https://github.com/GokselKUCUKSAHIN/es-query-builder/assets/33639948/ca9e2603-ebcd-4dec-92f4-e501ddcc4abe)

# Want to Contribute?

<details>
<summary><b>Join Us</b></summary>
<img src="https://github.com/GokselKUCUKSAHIN/es-query-builder/assets/33639948/bc696d14-a55d-4ec4-9cb4-021cc4128760" width="400px" alt="join us"/>
</details>

### Contribute to Our Project

Want to help out? Awesome! Here’s how you can contribute:

1. **Report Issues:** Got a suggestion, recommendation, or found a bug? Head over to the [Issues](https://github.com/GokselKUCUKSAHIN/es-query-builder/issues) section and let us know.

2. **Make Changes:** Want to improve the code?
- Fork the repo
- Create a new branch
- Make your changes
- Open a Merge Request (MR) to merge into the main repo

We’re excited to see your contributions. Thanks for helping make this project better!

# License

MIT - Please check the [LICENSE](./LICENSE) file for full text.
Expand Down

0 comments on commit 9a8e2e8

Please sign in to comment.