Index: java/org/apache/cocoon/doktor/DoktorMetadataTransformer.java
===================================================================
--- java/org/apache/cocoon/doktor/DoktorMetadataTransformer.java	(revision 209915)
+++ java/org/apache/cocoon/doktor/DoktorMetadataTransformer.java	(working copy)
@@ -64,7 +64,7 @@
     // example a line such as
     //  @ doktor-start type:code include-in-toc:true
     // should create two properties, type and include-in-toc
-    private final RE metaRegexp = new RE("@doktor[^ ]*[ ]+([a-zA-Z-_.]+:.*)+");
+    private final RE metaRegexp = new RE("@doktor[^ ]*[ ]+([a-zA-Z-_.]+:.*,?)+");
 
     /**
      * Set the <code>SourceResolver</code>, objectModel <code>Map</code>,
@@ -171,16 +171,18 @@
      * */
     private void parseMetadata(String str) throws SAXException {
         if(metaRegexp.match(str)) {
-            // start at 1, 0 contains the full matched expression
-            for(int i=1; i < metaRegexp.getParenCount(); i++) {
-                final String expr = metaRegexp.getParen(i);
-                final int pos = expr.indexOf(':');
-                if(pos > 0) {
-                    final String name = expr.substring(0,pos);
-                    final String value = expr.substring(pos+1);
-                    metadata.put(name,value);
-                }
-            }
+            /** We only getParen(1) without looping because Regexps only remember the
+             * last matches per parentheses grouping. The expression now just matches
+             * all the name-value pairs and we added a comma between them which
+             * enables us to easily process them 
+             */
+            //String of the form "name:value value, name:value, name-name: value"
+            final String pairs = metaRegexp.getParen(1);
+            String[] splitpairs = pairs.split(",");
+            for(int i=0; i<splitpairs.length; i++) {
+                String[] nameandvalue = splitpairs[i].split(":");
+                metadata.put(nameandvalue[0].trim(), nameandvalue[1].trim());
+            } 
         }
     }
 
Index: samples/snippets/snippets-to-index.xsl
===================================================================
--- samples/snippets/snippets-to-index.xsl	(revision 209915)
+++ samples/snippets/snippets-to-index.xsl	(working copy)
@@ -25,16 +25,34 @@
   xmlns:doktor="http://apache.org/cocoon/doktor/1.0"
 >
 
+  <xsl:param name="filename"/>
+
   <xsl:template match="/">
     <indexable-snippets>
       <xsl:apply-templates/>
     </indexable-snippets>
   </xsl:template>
+  
 
   <xsl:template match="doktor:snippet">
     <snippet>
+      <filename><xsl:value-of select="$filename"/></filename>
       <snippet-id><xsl:value-of select="@id"/></snippet-id>
+      <xsl:apply-templates select="//doktor:comment"/>
+      <xsl:apply-templates select="//doktor:metadata"/>
     </snippet>
   </xsl:template>
+  
+  <xsl:template match="doktor:comment">
+      <comment>
+      <xsl:value-of select="."/>
+      </comment>
+  </xsl:template>
+  
+  <xsl:template match="doktor:metadata">
+      <metadata>
+      <xsl:copy-of select="child::*"/>
+      </metadata>
+  </xsl:template>
 
 </xsl:transform>
Index: samples/snippets/sitemap.xmap
===================================================================
--- samples/snippets/sitemap.xmap	(revision 209915)
+++ samples/snippets/sitemap.xmap	(working copy)
@@ -25,6 +25,9 @@
         logger="sitemap.transformer.dotkor"
         name="doktor"
         src="org.apache.cocoon.doktor.DoktorMetadataTransformer"/>
+       <map:transformer name="index" 
+        logger="sitemap.transformer.luceneindextransformer" 
+        src="org.apache.cocoon.transformation.LuceneIndexTransformer"/>
     </map:transformers>
   </map:components>
 
@@ -55,6 +58,27 @@
     </map:component-configurations>
 
     <map:pipeline>
+      <!-- Testing the indexing of LuceneIndexTransformer -->
+      <map:match pattern="lit">
+        <map:generate src="{global:codebase}/luceneIndexTransformerTest.xml"/>
+        <map:transform type="index"/> 
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- Testing searching from the pipeline -->
+      <map:match pattern="searchQuery/*">
+        <map:generate type="search">
+          <map:parameter name="query" value="{1}"/>
+        </map:generate>  
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- Testing searching from the pipeline -->
+      <map:match pattern="**/neutraldoc">
+        <map:generate src="cocoon:/{1}"/>
+        <map:transform src="searchxml-to-neutralDoc.xsl"/>
+        <map:serialize type="xml"/>
+      </map:match>
 
       <!-- retrieve the list of snippets in a file -->
       <map:match pattern="**/doktor-snippets/">
@@ -71,7 +95,9 @@
         <map:transform src="snippet-selector.xsl">
           <map:parameter name="snippetId" value="{2}"/>
         </map:transform>
-        <map:transform src="snippets-to-index.xsl"/>
+        <map:transform src="snippets-to-index.xsl">
+            <map:parameter name="filename" value="{1}"/>
+        </map:transform>
         <map:serialize type="xml"/>
       </map:match>
 
Index: samples/annotated-code/xmlfile.xml
===================================================================
--- samples/annotated-code/xmlfile.xml	(revision 209915)
+++ samples/annotated-code/xmlfile.xml	(working copy)
@@ -22,7 +22,7 @@
 
 <somedata>
   <!-- @doktor key: firstExample -->
-  <!-- @doktor sitemap-param: something info: this parameter could set some value -->
+  <!-- @doktor sitemap-param: something, info: this parameter could set some value -->
   <parameter name="something"/>
   <nothing-here>
     <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
Index: samples/annotated-code/org/apache/cocoon/doktorexamples/AnnotatedClass.java
===================================================================
--- samples/annotated-code/org/apache/cocoon/doktorexamples/AnnotatedClass.java	(revision 209915)
+++ samples/annotated-code/org/apache/cocoon/doktorexamples/AnnotatedClass.java	(working copy)
@@ -35,7 +35,7 @@
   */
 public class AnnotatedClass {
 
-    /** @doktor-start type:code include-in-toc:true
+    /** @doktor-start type:code, include-in-toc:true
      *  To include code in a doktor annotation, surround it with
      *  -start and -end doktor tags
      * */
Index: samples/annotated-code/subdir/dummy-sitemap.xweb
===================================================================
--- samples/annotated-code/subdir/dummy-sitemap.xweb	(revision 209915)
+++ samples/annotated-code/subdir/dummy-sitemap.xweb	(working copy)
@@ -23,7 +23,7 @@
   <map:pipelines>
 
     <map:pipeline>
-      <!-- @doktor-start type:pipeline key:firstExample -->
+      <!-- @doktor-start type:pipeline, key:firstExample -->
       <!-- doktor will create a snippet with all nodes found between -start end -end tags -->
       <!-- useful to include several consecutive elements in a snippet -->
       <map:match pattern="dummy-sitemap">
Index: samples/sitemap.xmap
===================================================================
--- samples/sitemap.xmap	(revision 209915)
+++ samples/sitemap.xmap	(working copy)
@@ -21,7 +21,7 @@
 
   <map:pipelines>
     <map:pipeline>
-      <map:match pattern="">
+      <map:match pattern="index.html">
           <map:read src="index.html"/>
       </map:match>
 
Index: samples/index.html
===================================================================
--- samples/index.html	(revision 209915)
+++ samples/index.html	(working copy)
@@ -91,5 +91,17 @@
         </a>
       </li>
     </ul>
+    
+        <h2>Indexing, Searching, and Neutral Documents</h2>
+    <ul>
+      <li>
+        <a href="snippets/searchQuery/firstExample">Try to search our index for "firstExample"</a>
+      </li>
+      <li>
+        <a href="snippets/searchQuery/firstExample/neutraldoc">Neutral Document Generated from searchQuery for "firstExample"</a>
+      </li>
+
+    </ul>
+    
   </body>
 </html>
\ No newline at end of file
