Add a variable, apachesolr_index_comments_with_node (TRUE | FALSE) which controls whether or not comments are globbed onto nodes during indexing. There is no UI for this, so at this point you have to use $conf in $settings.php to set the variable.

Comments

robertdouglass’s picture

StatusFileSize
new2.65 KB

Committing this.

robertdouglass’s picture

Status: Needs review » Fixed
Scott Reynolds’s picture

Status: Fixed » Needs work

I just Ran into this problem and did something more hack-ish because I needed on a per node type.

Would you consider switching this to a per node type setting?

robertdouglass’s picture

Hmm. I'd consider it. Maybe you can roll a patch against this commit?

My next step is to create a module that indexes comments as documents so that you can search for comments exclusively.

pwolanin’s picture

Indeed - per node type does seem like the appropriate level of selection.

For 2.x, we should think about several possible options, including:

  1. on/off per node type
  2. with the node body or in a separate field per node type
  3. All the comments for one node as a separate document (though this would potentially give multiple search results to the same node)

Depending on getting the highlighting right, some variant of #2 would be good since it would allow you to search node only, node + comments, or comments only either as user options or admin options without reindexing and without duplicating the other meta data.

Scott Reynolds’s picture

To piggy back off of 2, you could then specify a mlt that only looks at the node body, instead of body + comments

Which would be a big win I think.

robertdouglass’s picture

Ok. I agree with all that. I don't think, though, that we want to pollute our interface with that level of complexity, and we also don't want to automatically implement every strategy because it causes index bloat. So I'm open to ideas about how we can architect it to be lean and mean, but give the admin the right amount of flexibility without overwhelming. Suggestions?

pwolanin’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.51 KB

Here's a patch for 1.x for per-type exclusion.

pwolanin’s picture

StatusFileSize
new1.67 KB

with README change

pwolanin’s picture

StatusFileSize
new2.33 KB

+ code comment

pwolanin’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

committed #10 to 6.x-1.x

pwolanin’s picture

Status: Needs review » Patch (to be ported)

needs to be ported to other branches

robertdouglass’s picture

Version: 6.x-2.x-dev » 5.x-2.x-dev

Committed to DRUPAL-6--2

claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea
StatusFileSize
new3.09 KB

Here's the patch against 5.x-2.x-dev

claudiu.cristea’s picture

Status: Patch (to be ported) » Fixed

Committed to CVS in #278734

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dark_religion’s picture

I had this problem. And couldn't solve it for a long time lol...

sthumuluri’s picture

Category: feature » support

Hi, I am trying to implement functionality to exclude comments from all of our nodes from indexing - is "apachesolr_index_comments_with_node" the variable that needs to be set in settings.php? When I look in the code - I do not see that variable being checked instead I see "apachesolr_exclude_comments_types". can you pls clarify?

quotesbro’s picture

I guess you looked in 6.x-1.x branch. This future was added to 6.x-2.x branch.

quotesbro’s picture

Category: support » feature