1

I am Trying to create a new Core in Solr and import data into it, but I am displaying this data on Kendo grid and I need to display data from one column from the DB in two different fields(columns)

Here is the Data in the column that i need to split into two different columns

10680756-1000-RAT

I need to split the "10680756" in 1 called called A and in another column called B

this is my data config and schema

<entity name="myTable" pk="testingId" 
query="select * from myTable" 
  >
  <field column="codeStatus" name="codeStatus"/> (this column has the data "10680756-1000-RAT")

I need to show it like:

Code Status            A           B
10680756-1000-RAT    10680756     1000
Ratan Servegar
  • 375
  • 1
  • 6
  • 21

1 Answers1

1

You can use an Update Request Processor to split the field into two separate fields (and still keep the original field if needed), for example by using a StatelessScriptUpdateProcessor and writing a small piece of javascript to split the field and add two new fields.

Another option is to use the PatternReplaceFilter or PatternReplaceCharFilter together with two copyField instructions. Use the PatternReplaceFilter to remove anything except for the part of the token you want to keep.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84