Amit
Amit

Reputation: 173

ElasticSearch JDBC River Structured Objects force array

I am using JDBC river to pull data to ElasticSearch from Oracle database.

As mentioned in following link, left join can be used to get multiple values of one column of same primary id record in single json array. But if there is only one records after left join, river doesn't create array, rather puts the value in the json field.

This is causing problem to NEST to understand the type of object.

https://github.com/jprante/elasticsearch-jdbc#structured-objects

So, is there any way to force some fields to be array even it has just one value?

Upvotes: 1

Views: 244

Answers (1)

Casey Johnson
Casey Johnson

Reputation: 311

There is a way to to do this using the bracket notation as described here JDBC river Bracket Notation

So basically in your SQL query if you have

Select tag as tag.name from tags

you need to change it to

Select tag as tag[name] from tags

hope this helps

Upvotes: 1

Related Questions