Search & Count: Add an option to early terminate document collection

The idea is to add an option which will let the user control the number of matched documents collected per shard before scoring (if applicable). This will be helpful for exists-type functionality or when not all matched document has to be scored.

Closes #6876 
Did not really get the part about `ToXContent` here. could you elaborate on that?

I was thinking something like:

```java
    class MaybeBoolean {

        private Boolean value;

        public MaybeBoolean(Boolean initialValue) {
            this.value = initialValue;
        }
         // called in the loop
        public void merge(Boolean mergeValue) {
            if (this.value == null && mergeValue != null) {
                this.value = mergeValue;
            } else if (mergeValue != null) {
                this.value |= mergeValue;
            }
        }
        
        // final value
        public Boolean getValue() {
            return value;
        }
    }
```