OutOfMemory error

If you have a lot of terms I guess so.
What is your query ?

I can't.

But have a look at Elastic Mapping explosion - #7 by Mark_Harwood