lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steffen <>
Subject DataImportHandler: Javascript transformer for splitting field-values
Date Wed, 19 Nov 2008 15:33:16 GMT
Hi everyone,
I'm currently working with the nightly build of Solr (solr-2008-11-17)
and trying to figure out how to transform a row-object with Javascript
to include multiple values (in a single multivalued field). When I try
something like this as a transformer:
function splitTerms(row) {
                        //each term should be duplicated into count field-values
                        //dummy-code to show the idea
                	return row;
<entity name="searchfeedback" pk="id" transformer="script:splitTerms"
query="SELECT term,count FROM termtable WHERE id=${}" />

The DataImportHandler debugger returns:
What it *should* return:

So, what am I doing wrong? My transformer will be invoked multiple
times from a MySQL-Query and in turn has to insert multiple values to
the same field during each invocation. It should do something similar
to the RegexTransformer (field splitBy)... is that possible? Right now
I have to use a workaround that includes the term-duplication on the
database sides, which is kinda ugly if a term has to be duplicated a

View raw message