Index a field for reviewing a change after last owner update
This is a generalization of the "reviewed" bit in ChangeJson, which
indicates that the current user has commented on the change more
recently than the change owner commented or added a patch set. At
index time, record this field for each user for whom this is true.
This will help us avoid another path by which we touch the database
when rendering search results.
Searching by this field takes two forms. Searching for
"reviewedby:<user>" finds all changes where a comment by a specific
user was newer than the last update by the owner. Searching for
"is:reviewed" finds all changes where at least one specific user left
a comment more recently than the last update by the owner. This is
implemented by internally converting to "-reviewedby:none", where
"none" is a special sentinel field stored in the index.
This replaces the existing "is:reviewed" semantics, which were
somewhat confusing as they bore no relation whatsoever to the
"reviewed" field in ChangeInfo. The new semantics mean
"reviewedby:self" can match exactly the set of changes for which the
"reviewed" field would be set.
Change-Id: Icb7192eb5c41890ee3f3ef0fecb3d91d15b744f9
10 files changed