Is there a way for ES to config maximum size for a single term?

default max length is 32766.
I'd like to make it small.

Yes, you can do this with the analysis chain: depending if you want to drop the too-big tokens (https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-length-tokenfilter.html) or truncate them to a smaller size (https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-truncate-tokenfilter.html)

got it. thanks very much