ian
ian

Reputation: 31

SOLR / LUCENE how to expand list into multi-valued fields?

I am indexing from a RDBMS. I have a column in a table with pipe separated values, and upon indexing I would like to transform these values into multi-valued fields. For example,

ColumnA (From RDBMS)
---------------------
apple|orange|banana

I want to transform this to:

SOLR Index
------------
Fruit=apple
Fruit=orange
Fruit=banana

Upvotes: 0

Views: 294

Answers (1)

Nick Clark
Nick Clark

Reputation: 4467

I you use a RegexTransformer, you can specify a splitBy="|"

<field column="Fruit" splitBy="|" sourceColName="ColumnA"/>

http://wiki.apache.org/solr/DataImportHandler#RegexTransformer

Upvotes: 6

Related Questions