It's unclear from your brief description what you are trying to accomplish. Could you please elaborate with a little more detail? Why do you need painless instead of existing queries to add restrictions based on your 8 fields?
As explained in this thread I believe you need to write some code in your application to handle this. I do not think using painless is the right way to go.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.