Example usage for org.apache.solr.common SolrInputDocument deepCopy

List of usage examples for org.apache.solr.common SolrInputDocument deepCopy

Introduction

In this page you can find the example usage for org.apache.solr.common SolrInputDocument deepCopy.

Prototype

public SolrInputDocument deepCopy() 

Source Link

Usage

From source file:org.alfresco.solr.AlfrescoCoreAdminTester.java

License:Open Source License

private void addContentToDoc(SolrInputDocument cachedDoc, Map<QName, String> content) {
    Collection<String> fieldNames = cachedDoc.deepCopy().getFieldNames();
    for (String fieldName : fieldNames) {
        if (fieldName.startsWith(AlfrescoSolrDataModel.CONTENT_S_LOCALE_PREFIX)) {
            String locale = String.valueOf(cachedDoc.getFieldValue(fieldName));
            String qNamePart = fieldName.substring(AlfrescoSolrDataModel.CONTENT_S_LOCALE_PREFIX.length());
            QName propertyQName = QName.createQName(qNamePart);
            addContentPropertyToDoc(cachedDoc, propertyQName, locale, content);
        }/*w ww  .ja  va2  s  . co  m*/
        // Could update multi content but it is broken ....
    }
}

From source file:org.alfresco.solr.AlfrescoSolrUtils.java

License:Open Source License

private static void addContentToDoc(SolrInputDocument cachedDoc, Map<QName, String> content) {
    Collection<String> fieldNames = cachedDoc.deepCopy().getFieldNames();
    for (String fieldName : fieldNames) {
        if (fieldName.startsWith(AlfrescoSolrDataModel.CONTENT_S_LOCALE_PREFIX)) {
            String locale = String.valueOf(cachedDoc.getFieldValue(fieldName));
            String qNamePart = fieldName.substring(AlfrescoSolrDataModel.CONTENT_S_LOCALE_PREFIX.length());
            QName propertyQName = QName.createQName(qNamePart);
            addContentPropertyToDoc(cachedDoc, propertyQName, locale, content);
        }/*from  ww  w .  ja va  2 s .  com*/
        // Could update multi content but it is broken ....
    }
}

From source file:org.alfresco.solr.SolrInformationServer.java

License:Open Source License

private void addContentToDoc(SolrInputDocument doc, long dbId) throws AuthenticationException, IOException {
    Collection<String> fieldNames = doc.deepCopy().getFieldNames();
    for (String fieldName : fieldNames) {
        if (fieldName.startsWith(AlfrescoSolrDataModel.CONTENT_S_LOCALE_PREFIX)) {
            String locale = String.valueOf(doc.getFieldValue(fieldName));
            String qNamePart = fieldName.substring(AlfrescoSolrDataModel.CONTENT_S_LOCALE_PREFIX.length());
            QName propertyQName = QName.createQName(qNamePart);
            addContentPropertyToDocUsingAlfrescoRepository(doc, propertyQName, dbId, locale);
        }/*w  w w  . j ava  2  s.  co  m*/
        // Could update multi content but it is broken ....
    }
}