Page MenuHomePhabricator

When "" changes, don't trust the old index versions

Authored by epriestley on Apr 2 2017, 4:33 PM.
Referenced Files
Unknown Object (File)
Apr 14 2017, 12:35 AM
Unknown Object (File)
Apr 10 2017, 8:24 AM
Unknown Object (File)
Apr 10 2017, 8:24 AM
Unknown Object (File)
Apr 10 2017, 8:24 AM
Unknown Object (File)
Apr 9 2017, 12:18 AM
Unknown Object (File)
Apr 3 2017, 10:01 PM
Unknown Object (File)
Apr 2 2017, 6:01 PM



Ref T12450. We track a "document version" for updating search indexes, so that if a document is rapidly updated many times in a row we can skip most of the work.

However, this version doesn't consider "" configuration, so if you add a new service (like a new ElasticSearch host) we still think that every document is up-to-date. When you run bin/search index to populate the index (without --force), we just do nothing.

This isn't necessarily very obvious. D17597 makes it more clear, by printing "everything was skipped and nothing happened" at the end.

Here, fix the issue by considering the content of "" when computing fulltext document versions: if you change, we throw away the version index and reindex everything.

This is slightly more work than we need to do, but changes to "" are rare and this is much easier than trying to individually track which versions of which documents are in which services, which probably isn't very useful anyway.

Test Plan
  • Ran bin/search index --type project, saw everything get skipped.
  • Changed
  • Ran search index again, saw everything get updated.
  • Ran a third time without changing, everything was properly skipped.

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable