Reputation: 173
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
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