Dynamic Field with SplitBy in db-config.xml not working Properly in Solr
Asked Answered
E

0

6

I'm Working with Solr 7.4.0 and using DIH Method For Indexing the Data.

Query in data-config.xml.

<entity name="Test" query="Select Names,Test_Value1,Test_Value2,Test_Value3 from TestTable">

        <field column="Names" name="Names" splitBy="," />
        <field column="Test_*" name="Test_*" splitBy="," />
</entity>

Schema.xml

<field name="Names" type="string" multiValued="true" indexed="true" />
<dynamicField name="Test_*" type="string" multiValued="true" indexed="true" />

After Completing the Indexing, Names easily gets separated as below and showing values as multiValue as required.
e.g

"Names":["Demo1",
          "Demo2"]

But When Working With dynamic Field as string type multiValue. Its Showing this result in Indexing.

"Test_Value1":["Test 1, Test 2, Test 3"],         

But I need this result as below.

"Test_Value1":["Test 1", "Test 2", "Test 3"],

How would separate the Values of Dynamic Field Values as shown above.

Ecclesiasticus answered 7/9, 2018 at 5:55 Comment(3)
Have you considered using a script transformer instead? The field definition in DIH can't match multiple fields as far as I know, but the script transformer will allow you to have a regex that matches the input field names and split the string into multiple values if it matches.Touchwood
Thank you for reply My field name is dynamic so i can not put static field in transformer so this will not solve my problemEcclesiasticus
But that doesn't matter - it just has to be active on one field, so in your example above it can be added to the Names field.Touchwood

© 2022 - 2024 — McMap. All rights reserved.