Example usage for org.apache.solr.schema IndexSchema isCopyFieldTarget

List of usage examples for org.apache.solr.schema IndexSchema isCopyFieldTarget

Introduction

In this page you can find the example usage for org.apache.solr.schema IndexSchema isCopyFieldTarget.

Prototype

public boolean isCopyFieldTarget(SchemaField f) 

Source Link

Document

Check if a field is used as the destination of a copyField operation

Usage

From source file:com.gu.solr.MergeUtils.java

License:Apache License

private static void addFields(Document luceneDoc, SolrDocument solrDoc, IndexSchema schema) {
    for (Fieldable f : (List<Fieldable>) luceneDoc.getFields()) {
        SchemaField sf = schema.getField(f.name());
        if (!schema.isCopyFieldTarget(sf)) {
            Object externalVal = sf.getType().toObject(f);
            solrDoc.addField(f.name(), externalVal);
        }/* w  w w  . j  ava2 s  .  c o  m*/
    }
}