I am trying to insert a comma-separated string as a multi-valued field in my morphine configuration from a string structure in HBase.
Can anyone suggest a better way or experience, I'm new to this.
Is there a way I can do this.
HBase-Indexer Mapper:
<?xml version="1.0"?> <indexer table="Document_Test" mapper="com.ngdata.hbaseindexer.morphline.MorphlineResultToSolrMapper" unique-key-field="documentId" mapping="row"> <param name="morphlineFile" value="/path/to/morphline.conf" /> </indexer>
Morphline Conf:
{ extractHBaseCells { mappings : [ { inputColumn : "CF:DocumentId" outputField : documentId type : long source : value } { inputColumn : "CF:Persons" outputField : persons type : string source : value } ] } // Some command here which can be used, I tried with **java**, But didn't worked and make it a single string }
It simply does one line as follows:
{ "persons": [ "[Panos Kammenos, King Salman, Nabil Sadek, Ehab Azmy, Hesham Abdelhamid]" ], "documentId": 38900223, "_version_": 1535233203724353500 }
UPDATED
Tried this, and he worked on mappings based on the Row or Tall structure.
{ extractHBaseCells { mappings : [ { inputColumn : "CF:DocumentId" outputField : documentId type : long source : value } { inputColumn : "CF:Persons" outputField : persons type : string source : value } ] } } { split{ inputField : persons outputField : persons_multi separator : "," isRegex : false } }
source share