Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When you enable node access on an index, currently the published field is forced to be index, but the uid/author is required as well.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1324182--index-author-for-node-access-2.patch | 2.55 KB | drunken monkey |
#1 | 1324182-force-index-author.patch | 1.06 KB | dawehner |
Comments
Comment #1
dawehnerHere is the patch. In general i'm not sure whether it's required to index both author and uid.
Comment #2
drunken monkeyThanks for catching that, you're right of course! But now I really checked, nothing else should be required.
We only need either uid or author, depending on what we use for the query. I now opted for "author", as it is considerably more useful for other purposes, and thus more likely to be indexed in any case. Thanks for that suggestion, too!
In theory, we could dynamically check if either of the fields is indexed and use that one, but in practice I think there's really no benefit in indexing "uid" anyways.
Patch attached, using "author".
Comment #3
dawehnerThanks! This patch works perfect at least for the version i use here.
Comment #4
drunken monkeyGreat, committed.