Elasticsearch custom ingest plugin error when indexing with a field of type doble[]

I have been developing an ingest plugin that connects to a remote server and gets from it the projection of the document of the form:

"vector": [
0.0021645021645200296,
0.0021645021645200296,
0.0021645021645200296,
0.0021645021645200296,
0.0021645021645200296,
0.0021645021645200296,
0.0021645021645200296,
0.0021862559551182196,
0.0047532032457047735,
0.0021645021645200296,
0.0021645021645200296,
0.0021645021645200296,
0.0021645021645200296,
0.002186255955118221,
0.0021645021645200296,
0.0021645021645200296,
0.0021862559551182196,
0.0022080097457164096,
0.0021645021645200296,
]

I parse it to a double array in java, but when indexing it the following error arises:

<
1> "type" : "illegal_argument_exception",
1> "reason" : "unexpected value type [class [D]",
1> "stack_trace" : "java.lang.IllegalArgumentException: unexpected value type [class [D]
/>

Is there any way I can index numerical arrays as a field?

Full code of the project: https://github.com/bLozanoUPM/ingest-library

It looks like you are passing a double[]. I'm not sure the ingest document class knows how to handle that. In general it expects something serializable back to json, so I would try List<Double> instead.

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