require hasn't been supported and lang-javascript is deprecated in 5.x and will be removed in 6.0 so I don't expect it'll ever be supported. Since none of the languages you can embed in the JVM have working of security or ability to limit execute time we built our own. At this point we're advising everyone to use lang-painless because it has those things. It is still new and rough around the edges but it isn't fundamentally broken for our use case.
Is it possible to use msgpack in Painless scripting?
fore example:
{
"script" : {
"lang": "painless",
"inline": "MessagePack msgpack = new MessagePack(); ctx._source= msgpack .unpack(ctx._source.num)",
"params" : {
"factor" : 4
}
}
}
Possible but fairly unlikely. For the most part we recommend folks store data in JSON so it works well with Elasticsearch. If you don't want fields to be indexed for search you can set "index": false on them and you can turn off doc values with "doc_values": false. At that point Elasticsearch pretty much just stores the field in the _source json and ignores it. I expect MessagePack would save a bit of space but not much on disk because _source is compressed in blocks with other source documents.
I understand that many HTTP client do not/can not make use of SMILE because it's a Java API feature. To add blindly another binary compression on top of SMILE just for docs with inline scripts adds significant load on Elasticsearch cluster nodes.
Instead, you would have to examine the XContent API and replace SMILE by your codec, so all server nodes and client nodes could speak the same serialization language. This is even more than an ordinary Elasticsearch plugin could do, you'd have to exchange the transport layer. I hardly can see any justification of such a replacement.
Note, in that context, that Elasticsearch did once support Thrift as an optional node protocol beside compressed JSON https://github.com/elastic/elasticsearch-transport-thrift but that project had been stopped because benefit is too low.
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.