Package com.sematext.searchschemer.reader.solr

Source Code of com.sematext.searchschemer.reader.solr.SolrDynamicFieldsDefinitionReader

package com.sematext.searchschemer.reader.solr;

import java.io.File;
import java.util.ArrayList;

import org.apache.commons.digester3.Digester;

import com.sematext.searchschemer.index.solr.SolrFieldAttributes;

/**
* Reader for static fields defined in Solr schema.xml file.
*
* @author Sematext
*
*/
public class SolrDynamicFieldsDefinitionReader extends SolrStaticFieldsDefinitionReader {
  /**
   * Constructor.
   *
   * @param file
   *          file to parse
   */
  public SolrDynamicFieldsDefinitionReader(File file) {
    super(file);
  }
 
  /**
   * {@inheritDoc}
   */
  @Override
  protected void initializeDigester() {
    digester = new Digester();
    digester.setNamespaceAware(true);
    digester.addObjectCreate("schema/fields", ArrayList.class);
    digester.addObjectCreate("schema/fields/dynamicField", SolrFieldAttributes.class);
    digester.addSetProperties("schema/fields/dynamicField/");
    digester.addSetNext("schema/fields/dynamicField", "add");
  }
}
TOP

Related Classes of com.sematext.searchschemer.reader.solr.SolrDynamicFieldsDefinitionReader

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.