Мне нужно получить поле «данные» под «настроениями» в упругой поисковой БД, как показано ниже. Я смог написать код, чтобы получить часть настроения, но не знал, как получить часть «данные». может кто-нибудь показать мне правильный код для этого?
KIBANA результат
"hits": [
{
"_index": "local_rs_4_0_0_app_reviewspotter_1552993787904",
"_type": "review",
"_id": "r_anuradhapura_1553834187140",
"_score": 1,
"_source": {
"sentiments": [
{
"voice": "POSITIVE",
"referencedChunks": [
{
"voice": "NEGATIVE",
"data": "I’ve always stay here when I come to San Diego",
"subjects": [],
"start": 159,
"weight": -0.5,
"end": 205,
"text": "I’ve always stay here when I come to San Diego"
}
],
"data": " it looks like I will have to find another place.",
"subjects": [
{
"voice": "POSITIVE",
"fact": "location",
"effectiveChunk": {
"start": 219,
"end": 257
},
"data": "location",
"start": 252,
"qualities": [
{
"data": "pos_emotion",
"strength": "null",
"start": 219,
"weight": 50,
"end": 223,
"text": "like",
"qualityType": "POSITIVE",
"strengthEnd": -1,
"strengthStart": -1
}
],
"weight": 0.5,
"end": 257,
"text": "place"
}
],
"start": 219,
"weight": 0.5,
"end": 257,
"text": "like I will have to find another place"
}
]
}
},
Java-код
ArrayList sentimentData = ( ArrayList ) esReader.readAsPairRDD( index, type, "*" ).collect().get( 0 )._2.get( "sentiments" );