Community & Support

Drupal cannot search comments separately,more importantly CANNOT find the names of comment posters from the search or users tab!

This post has been edited - if you need at all to check what, see the Revisions.

Drupal cannot search comments SEPARATELY or what is MORE important - CANNOT find the names of comment posters from the search or users tab!

Another competitor CMS e107 has a nice dropdown menu to choose from news, forum posts, *comments*etc, without going into a very detailed advanced search page.

Many sites have more than 50% or 3/4ths of their content coming from comment and many sites allow anon comments and those posters to post their name. It becomes impossible to search by those names as it appears Drupal tab "Users" in Search means == Registered Users and not just site users.

More discussions happen in the posts below. If you have constructive input as how to overcome this it will be greatly appreciated.

Comments

I too feel that search in

I too feel that search in Drupal seriously needs enhancement. It's frustrating.

Test again

Drupal core search _does_ search comments in the simple search. Please test more carefully before complaining.

link me to a working site or demo

@Markj, I have done testing and submitted several issues. But I may be wrong and will be very happy if you prove or show me how I am wrong. I need quick solutions or work around and if the post sounded like complaint it was to draw attraction.

Drupal.org team member Jhodgdon said that searchable "content" includes just nodes - see http://drupal.org/node/523894#comment-1849472

My actual problem started with not finding the names of persons who posted comment. For example, there is no need of registering and this encourages Mr. Mark to post comments frequently in March and then is away for some time and back in July, how he finds what he posted ?

Markj,I have tested with Drupl 6.13 and it seems that any unique word which is in a comment only is NOT being found by search. This is obviously not a problem with some drupla sites I just checked now - so I will test more with D 6.13. I will be glad if you link me to a working site or demo which supports what you say.

In the meanwhile please also see http://drupal.org/node/523894

Test at this site

Hi Kaakuu, go to http://drupalib.interoperating.info/ and search the two words november surveying. These two words only occur in one comment on the site. You are correct -- the commenter's name is not indexed. But the text of the comments is.

Hi Markj - You are absolutely right

Hi Markj - You are absolutely right. I need not go to this site as I tested some other Drupal sites using the core or basic search meanwhile. Though there are some inconsistent findings on the latest Drupal 6.13 test sites which needs further testing or correcting my findings etc.

The main problem started when I found comment posters CANNOT find there names on search. This probably happens on solr search too ( not confirmed ) . So I started posting issues when Drupal member Jhodgdon said that searchable "content" includes just nodes - http://drupal.org/node/523894#comment-1849472. After that I made this post.

My main problem still persists and after several status changes to and fro it has been marked as a bug again http://drupal.org/node/523894#comment-1852374

My apologies for complaining and it will be great if you have a solution to this very serious and annoying problem.

A custom module could easily do this

This is little consolation if you are not a coder who can write a Drupal module, but it would be possible to use hook_nodeapi($op = 'update index') to pull in the names of all users who have commented on each node and then add them to Drupal core's search index. If you want to some code to get you started, see Pro Drupal Development Second Edition, page 303.

Thanks.

Thanks.

As pointed out by Damien
"the comment_nodeapi() function only adds the following to the node:

<?php
$text
.= '<h2>'. check_plain($comment->subject) .'</h2>'. check_markup($comment->comment, $comment->format, FALSE);
?>
"

Can you give some specific code that can be added here for the purpose in discussion ?

Thanks and one more question

Thanks to everyone for valuable input. It is warm feeling too to get responses since many posts go with 0 replies ( for whatever valid reasons )

I will like to put up another problem with search, if any one has any idea. I posted this in the forum before too but with no reply.

The problem statement is like this :

"When I enter an user name in the user tab of Search I expect a list of items that has the user name in it even if those are not necessarily posts created by that user name. However this does not happen when I have profile access turned off. Ideally search/user should list the contents by the user
but instead it throws up an Access denied page.
Any lightweight module or core-hack to achieve this ?"

_

Not ideal-- but you can also easily create a comment search form (for author, body, title, etc) with views and exposed filters.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Thanks but how

I tried but how to include the anon comment posters who havetyped in their names ?
This seems impossible to be done by me unless some one posts a proof-of-concept.

This will also mean a separate search form which is a strict no-no!

I just had a user ask for this today, and I completely agree it should be there. It's important to me and my readers, as - pointed out above - there's a lot of content in comments. Some readers use comments as a mini-blog for /themselves/! I'm not a Drupal developer, so I'd have to hire someone to do this and update my UI. :-( At least it's /possible/...

search result should link to specific comment

Search results just return a link to the node, not the specific comment (http://example.com/node/4#comment-44). If a node has lots of comments the search result becomes meaningless.

This stuff has already been discussed two years ago: http://drupal.org/node/232947

nobody click here