this is from nutch/src/java/org/apache/nutch/indexer/solr/SolrWriter.java write function:

@Override
  public void write(NutchDocument doc) throws IOException {
    final SolrInputDocument inputDoc = new SolrInputDocument();
    for(final Entry<String, List<String>> e : doc) {
      for (final String val : e.getValue()) {

        Object val2 = val;
        if (e.getKey().equals("content") || e.getKey().equals("title")) {
          val2 = stripNonCharCodepoints(val);
        }

        inputDoc.addField(solrMapping.mapKey(e.getKey()), val2);
        String sCopy = solrMapping.mapCopyKey(e.getKey());
        if (sCopy != e.getKey()) {
         inputDoc.addField(sCopy, val2);
        }
      }
    }


as you can see it checks to see if the field is mapped to a different name and if that is the case, it adds it under the original key in addition to the mapped key. why are we doing this?

--
Kaveh Minooie

Reply via email to