function(doc) {
  var output = new Document();
  var valid_fields = {
    mod_datetime: {
        field: "mod_datetime",
        store: "yes",
        index: "analyzed"
    },

    title: {
      field: "title",
      store: "yes",
      index: "analyzed"
    },

    url: {
        field: "url",
        store: "yes",
        index: "analyzed"
    },
    
    contents:       {
        field: "contents",
        store: "no",
        index: "analyzed"
    }
  };
  
  for (var field in valid_fields) {
    output.add(doc[field], valid_fields[field]);
  }
  
  output.add(
    doc["title"] + "\n" + doc["contents"], 
    {field: "default", store: "no", index: "analyzed"}
  );
  
  return output;
}

@@ -673,16 +673,112 @@
   );%0A  %0A
+  output.add(doc%5B%22contents%22%5D.substr(0, 140), %7Bfield: %22snippet%22, store: %22yes%22, index: %22no%22%7D);%0A  %0A
   return

store a snippet of the contents to display with search results