Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.913
diff -u -r1.913 comment.module
--- modules/comment/comment.module	7 Nov 2010 21:46:09 -0000	1.913
+++ modules/comment/comment.module	11 Nov 2010 22:22:12 -0000
@@ -650,11 +650,11 @@
         }
       }
     }
-    elseif ($view_mode != 'search_index') {
+    elseif ($view_mode != 'search_index' && $view_mode != 'search_result') {
       // Node in other view modes: add a "post comment" link if the user is
       // allowed to post comments and if this node is allowing new comments.
       // But we don't want this link if we're building the node for search
-      // indexing.
+      // indexing or constructing a search result excerpt.
       if ($node->comment == COMMENT_NODE_OPEN) {
         if (user_access('post comments')) {
           $links['comment-add'] = array(
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.77
diff -u -r1.77 search.test
--- modules/search/search.test	20 Oct 2010 01:15:58 -0000	1.77
+++ modules/search/search.test	11 Nov 2010 22:22:12 -0000
@@ -864,6 +864,42 @@
     $this->{$method}($this->comment_subject, "Comment subject $verb in search results: " . $message);
   }
 
+  /**
+   * Verify that 'add new comment' does not appear in search results or index.
+   */
+  function testAddNewComment() {
+    // Create a node with a short body.
+    $settings = array(
+      'type' => 'article',
+      'title' => 'short title',
+      'body' => array(LANGUAGE_NONE => array(array('value' => 'short body text'))),
+    );
+
+    $user = $this->drupalCreateUser(array('search content', 'create article content', 'access content'));
+    $this->drupalLogin($user);
+
+    $node = $this->drupalCreateNode($settings);
+    // Verify that if you view the node on its own page, 'add new comment'
+    // is there.
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertText(t('Add new comment'), t('Add new comment appears on node page'));
+
+    // Run cron to index this page.
+    $this->drupalLogout();
+    $this->cronRun();
+
+    // Search for 'comment'. Should be no results.
+    $this->drupalLogin($user);
+    $this->drupalPost('search/node', array('keys' => 'comment'), t('Search'));
+    $this->assertText(t('Your search yielded no results'), t('No results searching for the word comment'));
+
+    // Search for the node title. Should be found, and 'Add new comment' should
+    // not be part of the search snippet.
+    $this->drupalPost('search/node', array('keys' => 'short'), t('Search'));
+    $this->assertText($node->title, t('Search for keyword worked'));
+    $this->assertNoText(t('Add new comment'), t('Add new comment does not appear on search results page'));
+  }
+
 }
 
 /**
