There is an option for running a script to get the value. You'd use a script like doc['ci.rc.keyword'].value.charAt(0).
That might not work properly if the character doesn't fit in basic multilingual plane, but it probably does and the script would be a bit more complex than I can compose in an email if it had to deal with that.
"script" : "doc['ci.rc'].value.charAt(0)",
"lang" : "painless",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [hi.rc] in order to load field data by uninverting the inverted index. Note that this can use significant memory."
"script" : "doc['ci.rc.keyword'].value.charAt(0)",
"lang" : "painless",
"caused_by" : {
"type" : "illegal_state_exception",
"reason" : "A document doesn't have a value for a field! Use doc[<field>].size()==0 to check if a document is missing a field!"
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.