elastic / elastic/elasticsearch-dsl-ruby

[DSL] handle multiple values (array)

Open
#2 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
18
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Is my understanding correct that if i want to do

```
{
"query": {
"bool": {
"must": [
{
"term": {"shape": "round"}
},
{
"bool": {
"should": [
{"term": {"color": "red"}},
{"term": {"color": "blue"}}
]
}
}
]
}
}
}
```

I would have to write:

```
query do
bool do
must do
term shape: round
end
must do
bool do
should do
term color: red
end
should do
term color: blue
end
end
end
end
end
```

(notice the multiple must/should blocks)

i didn't receive any error message when putting multiple terms into one must block - it just swallowed the further ones

did i do something wrong? am i misunderstanding something? is there a way to do "array-like" syntax that i am unaware off?

If this is by design - are there any other differences to the JSON syntax i should be aware off?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.