Two common mistakes we see when folks are writing compound operator.
For instance, two must
or should
keys under compound
.
Example:
{
"search": {
"compound": {
"must": {
"text": {
"path": "title",
"query": "bistro"
}
},
"must": { // this "must" overwrites on the first
"text": {
"path": "description",
"query": "bistro"
}
}
}
}
}
For instance, two query operators like text
under must
or under should
.
Example:
{
"search": {
"compound": {
"must": {
"text": {
"path": "title",
"query": "bistro"
},
"text": { // this "text" overwrites the first
"path": "description",
"query": "bistro"
}
}
}
}
}
Object keys must be unique always. To specify multiple clauses, they must appear as objects under an array.
Example:
{
"search": {
"compound": {
"must": [
{
"text": {
"path": "title",
"query": "bistro"
}
},
{
"text": {
"path": "description",
"query": "bistro"
}
}
]
}
}
}