I'd be happy to roll a patch if this is something the maintainers are willing to consider. At the moment solr indexes ds_last_comment_or_change which is the latest of node->changed and last_comment_timestamp, but last_comment_timestamp itself can be relevant for some use cases (sorting, or displaying last comment date in search results). I happen to need this for a project and will have to write some custom code, but I'm sure this could be useful for some.

Comments

pwolanin’s picture

I don't feel strongly - I think we used the combined one based on core search or node module code.

elliotttf’s picture

If it's not going to degrade performance I'd say go for it. It's something that I've added in custom modules on a couple of sites so would be convenient to have it already included.

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

here's an untested patch.

elliotttf’s picture

StatusFileSize
new1.08 KB

Needed to make one minor tweak to the comment timestamp and rerolled to line up with latest head.

elliotttf’s picture

Status: Needs review » Reviewed & tested by the community

Other than that though this works.

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

thanks for testing/re-rolling

Status: Fixed » Closed (fixed)

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

scor’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new710 bytes
+++ b/apachesolr.index.inc
@@ -76,8 +76,13 @@ function apachesolr_node_to_document($node, $namespace) {
+    if (isset($node->last_comment_timestamp)) {

The value $node->last_comment_timestamp will always be set as long as the comment module is enabled, that's a bug in core: #1112044: Fix $node->last_comment_timestamp and introduce $node->last_activity_timestamp. So what we need to test here is if we actually have comments or not.

pwolanin’s picture

Status: Needs review » Reviewed & tested by the community

looks fine.

jpmckinney’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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