### Description

There is a hard limit on the size of terms that can be indexed in lucene.  However, we don't check this at query time, which can lead to memory issues if the term query in question is case insensitive.  Very long terms are normally a sign of user error, so we should check up-front the length of the input and throw and exception if it is greater than `IndexWriter.MAX_TERM_LENGTH`.
server/src/main/java/org/elasticsearch/index/query/AbstractQueryBuilder.java
@Override
    public final String queryName() {
        return queryName;
    }
    /**
     * Returns the boost for this query.
     */
    @Override
    public final float boost() {
        return this.boost;
    }
    protected final void checkNegativeBoost(float boost) {
        if (Float.compare(boost, 0f) < 0) {
            throw new IllegalArgumentException(
                "negative [boost] are not allowed in [" + toString() + "], use a value between 0 and 1 to deboost"
            );
        }
    }
    /**
     * Sets the boost for this query.  Documents matching this query will (in addition to the normal
     * weightings) have their score multiplied by the boost provided.
     */
    @SuppressWarnings("unchecked")
    @Override
    public final QB boost(float boost) {
        checkNegativeBoost(boost);
        this.boost = boost;
        return (QB) this;
    }
    protected final QueryValidationException addValidationError(String validationError, QueryValidationException validationException) {