How to access the _index object through painless inline

i need the POSITIONS info, it's ok to get it by the groovy language:

"script": {
        "inline": "def s = 0;termInfo=_index['goods_name_separate'].get('book',_POSITIONS| _CACHE);for(pos in termInfo){s++; break;}; return s;",
        "lang": "groovy"
      }

but how to access the _index object through painless and java?
i got compile error when turning lang to painess.
i am using 5.1.2.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.