Salem's Euphoria

Sharing Experience


Leave a comment

Implicit updateRequestProcessorChain call – Solr

How to concat two fields in schemaless mode with Solr in Cloud mode?

1 – Create a js script file (concat_fields.js) and edit the following code:


function processAdd(cmd) {
doc = cmd.solrDoc;
id = doc.getFieldValue("id");
val1= doc.getField('field1').getValue();
val2 = doc.getField('field2').getValue();
separator = params.get('separator');
doc.setField("field3", val1+separator+val2);
}

Continue reading

Advertisements