Examples of SolrInputDocument


Examples of org.apache.solr.common.SolrInputDocument

        return null; // no need to recurse down the removed subtree
    }

    private SolrInputDocument docFromState(NodeState state) {
        SolrInputDocument inputDocument = new SolrInputDocument();
        String path = getPath();
        if (!path.endsWith("/")) {
            path = path + "/";
        }
        inputDocument.addField(configuration.getPathField(), path);
        for (PropertyState property : state.getProperties()) {
            // try to get the field to use for this property from configuration
            String fieldName = configuration.getFieldNameFor(property.getType());
            if (fieldName != null) {
                inputDocument.addField(
                        fieldName, property.getValue(property.getType()));
            } else {
                // or fallback to adding propertyName:stringValue(s)
                if (property.isArray()) {
                    for (String s : property.getValue(Type.STRINGS)) {
                        inputDocument.addField(property.getName(), s);
                    }
                } else {
                    inputDocument.addField(
                            property.getName(), property.getValue(Type.STRING));
                }
            }
        }
        return inputDocument;
View Full Code Here
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.