code: private void updateScalarReplaceValue(String currentValue, String newValue) {
          m_dbTran.addScalarValueColumn(m_tableDef, m_dbObj.getObjectID(), m_fieldName, newValue);
          Set<String> currTermSet = tokenize(Utils.isEmpty(currentValue) ? "" : currentValue);
          Set<String> newTermSet = tokenize(newValue);
          for (String term : currTermSet) {
              if (!newTermSet.remove(term)) {
                  unindexTerm(term);
              }
          }
          indexTerms(newTermSet);
          addFieldTermReferences(newTermSet);
          if (Utils.isEmpty(currentValue)) {
              addFieldReference();
          }
      }
docs: This works for both SV and MV scalar fields