Example usage for org.apache.solr.common.util NamedList setName

List of usage examples for org.apache.solr.common.util NamedList setName

Introduction

In this page you can find the example usage for org.apache.solr.common.util NamedList setName.

Prototype

public void setName(int idx, String name) 

Source Link

Document

Modifies the name of the pair at the specified index.

Usage

From source file:edu.upenn.library.solrplugins.CaseInsensitiveSortingTextField.java

License:Apache License

@Override
public void updateExternalRepresentation(NamedList<Object> nl) {
    for (int i = 0; i < nl.size(); i++) {
        String rawName = nl.getName(i);
        String externalName = readableToExternal(rawName);
        nl.setName(i, externalName);
        Object val = nl.getVal(i);
        Object updatedVal;//from w ww .ja  v  a2 s .  c om
        if (!(val instanceof Number) && (updatedVal = updateValueExternalRepresentation(val)) != null) {
            nl.setVal(i, updatedVal);
        }
    }
}

From source file:org.alfresco.solr.component.RewriteFacetCountsComponent.java

License:Open Source License

/**
 * Update entries in a list to reference ACS properties rather than Solr fields.
 *
 * @param mappings The mapping from ACS properties to Solr fields.
 * @param propertyList The list to update.
 *///from  w w w  .  java  2 s . c  om
private void updateToACSNaming(BiMap<String, String> mappings, NamedList<Object> propertyList) {
    for (int i = 0; i < propertyList.size(); i++) {
        String name = propertyList.getName(i);
        String newName = mappings.inverse().get(name);
        if (newName != null) {
            propertyList.setName(i, newName);
        }
    }
}