You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by kaveh minooie <ka...@plutoz.com> on 2013/04/11 19:43:37 UTC

so why does solrindex-mapping.xml get ignored?

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