Skip to content

Commit

Permalink
chore: change pure naming to vanilla
Browse files Browse the repository at this point in the history
  • Loading branch information
GokselKUCUKSAHIN committed Jun 5, 2024
1 parent bd55a00 commit 3eb019f
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 17 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# es-query-builder [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Go Report Card][go-report-img]][go-report] [![Coverage Status][cov-img]][cov]
A simple, user-friendly, and streamlined library for programmatically building Elasticsearch DSL queries in Go, designed for low overhead and minimal memory usage.

A simple, user-friendly, and streamlined library for programmatically building Elasticsearch DSL queries in Go, designed
for low overhead and minimal memory usage.

## How to Get

To install the es-query-builder library, run the following command:

```bash
go get github.com/GokselKUCUKSAHIN/es-query-builder
```

### Examples
### Examples

```json
{
Expand Down Expand Up @@ -46,7 +50,8 @@ go get github.com/GokselKUCUKSAHIN/es-query-builder
}
```

With pure Go
With vanilla Go

```go
query := map[string]interface{}{
"query": map[string]interface{}{
Expand Down Expand Up @@ -100,9 +105,11 @@ query := es.NewQuery(
```

# Benchmarks

You can check and run [benchmarks](./benchmarks) on your machine.

### ARMv6l

- **Device**: Raspberry Pi Zero W
- **CPU**: Broadcom BCM2835 1GHz 1 Core
- **Arch**: ARM v6 32 bit
Expand All @@ -112,6 +119,7 @@ You can check and run [benchmarks](./benchmarks) on your machine.
![armv6l](https://github.com/GokselKUCUKSAHIN/es-query-builder/assets/33639948/8972003d-9b00-4021-9f69-347723ac59de)

### ARM64

- **Device**: MacBook Pro 16" 2021
- **CPU**: Apple Silicon M1 Pro 10 Core
- **Arch**: ARM64
Expand All @@ -121,13 +129,21 @@ 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)

# License

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

[doc-img]: https://godoc.org/github.com/GokselKUCUKSAHIN/es-query-builder?status.svg

[doc]: https://godoc.org/github.com/GokselKUCUKSAHIN/es-query-builder

[go-report-img]: https://goreportcard.com/badge/github.com/GokselKUCUKSAHIN/es-query-builder

[go-report]: https://goreportcard.com/report/github.com/GokselKUCUKSAHIN/es-query-builder

[cov-img]: https://codecov.io/gh/GokselKUCUKSAHIN/es-query-builder/branch/main/graph/badge.svg

[cov]: https://codecov.io/gh/GokselKUCUKSAHIN/es-query-builder

[ci-img]: https://github.com/GokselKUCUKSAHIN/es-query-builder/actions/workflows/build-test.yml/badge.svg

[ci]: https://github.com/GokselKUCUKSAHIN/es-query-builder/actions/workflows/build-test.yml
4 changes: 2 additions & 2 deletions benchmarks/aggs_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ func createAggsQueryVanillaGo() string {

func Test_Aggs_Queries_are_equal(t *testing.T) {
build := createAggsQuery()
pure := createAggsQueryVanillaGo()
assert.Equal(t, pure, build)
vanilla := createAggsQueryVanillaGo()
assert.Equal(t, vanilla, build)
}

func Benchmark_Aggs_Example_Builder(b *testing.B) {
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/complex_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ func createComplexQueryVanillaGo(id int) string {
func Test_Complex_Queries_are_equal(t *testing.T) {
id := 76
build := createComplexQuery(id)
pure := createComplexQueryVanillaGo(id)
assert.Equal(t, pure, build)
vanilla := createComplexQueryVanillaGo(id)
assert.Equal(t, vanilla, build)
}

func Benchmark_Complex_Builder(b *testing.B) {
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/conditional_complex_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func createConditionalQueryVanillaGo(items []int) string {
func Test_Conditional_Queries_are_equal(t *testing.T) {
items := []int{1, 1, 2, 3, 5, 8, 13, 21, 34, 55}
build := createConditionalQuery(items)
pure := createConditionalQueryVanillaGo(items)
assert.Equal(t, pure, build)
vanilla := createConditionalQueryVanillaGo(items)
assert.Equal(t, vanilla, build)
}

func Benchmark_Conditional_Builder(b *testing.B) {
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/intermediate_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ func createIntermediateQueryVanillaGo(id int) string {
func Test_Intermediate_Queries_are_equal(t *testing.T) {
id := 42
build := createIntermediateQuery(id)
pure := createIntermediateQueryVanillaGo(id)
assert.Equal(t, pure, build)
vanilla := createIntermediateQueryVanillaGo(id)
assert.Equal(t, vanilla, build)
}

func Benchmark_Intermediate_Builder(b *testing.B) {
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/nested_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func createNestedQueryVanillaGo() string {

func Test_Nested_Queries_are_equal(t *testing.T) {
build := createNestedQuery()
pure := createNestedQueryVanillaGo()
assert.Equal(t, pure, build)
vanilla := createNestedQueryVanillaGo()
assert.Equal(t, vanilla, build)
}

func Benchmark_Nested_Example_Builder(b *testing.B) {
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/simple_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ func createSimpleQueryVanillaGo() string {

func Test_Simple_Queries_are_equal(t *testing.T) {
build := createSimpleQuery()
pure := createSimpleQueryVanillaGo()
assert.Equal(t, pure, build)
vanilla := createSimpleQueryVanillaGo()
assert.Equal(t, vanilla, build)
}

func Benchmark_Simple_Builder(b *testing.B) {
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/ty_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func Test_TyExample_Queries_are_equal(t *testing.T) {
brandIds := []int64{11, 22, 33, 44}
storefrontIds := []string{"35", "36", "43", "48", "49", "50"}
build := createTyExampleQuery(brandIds, storefrontIds)
pure := createTyExampleQueryVanillaGo(brandIds, storefrontIds)
assert.Equal(t, pure, build)
vanilla := createTyExampleQueryVanillaGo(brandIds, storefrontIds)
assert.Equal(t, vanilla, build)
}

func Benchmark_Ty_Example_Builder(b *testing.B) {
Expand Down

0 comments on commit 3eb019f

Please sign in to comment.