# Query dsl span\_or vs bool should

**URL:** <https://discuss.elastic.co/t/query-dsl-span-or-vs-bool-should/323254>\
**Category:** Elasticsearch\
**Created:** [January 16, 2023, 1:34pm UTC](https://discuss.elastic.co/t/query-dsl-span-or-vs-bool-should/323254 "2023-01-16T13:34:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IvanTushin](https://avatars.discourse-cdn.com/v4/letter/i/dbc845/32.png) [@IvanTushin](https://discuss.elastic.co/u/IvanTushin)\
**Post date:** [January 16, 2023, 1:34pm UTC](https://discuss.elastic.co/t/query-dsl-span-or-vs-bool-should/323254/1 "2023-01-16T13:34:13Z")

</div>

Hi! I have two "span\_near" queries. What's the difference between bool-\>should and span\_or? Does it affect on "index.query.bool.max\_clause\_count" limit or query performance?

```auto
{
    "span_or": {
        "clauses": [
            {
                "span_near": {...}
            },
            {
                "span_near": {...}
            }
        ]
    }
}

```

vs

```auto
{
    "bool": {
        "should": [
            {
                "span_near": {...}
            },
            {
                "span_near": {...}
            }
        ]
    }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 13, 2023, 1:34pm UTC](https://discuss.elastic.co/t/query-dsl-span-or-vs-bool-should/323254/2 "2023-02-13T13:34:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
