build_index.pl 852 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env perl
  2. use v5.36;
  3. use re '/aa';
  4. use lib 'lib';
  5. use Trog::Data;
  6. use Trog::Config;
  7. use Trog::SQLite::TagIndex;
  8. =head1 SYNOPSIS
  9. Rebuild the post index and the route table from the posts on disk.
  10. Use this to build the post index after you import data, otherwise it's not
  11. needed -- the index is maintained as posts are written, so the only time it
  12. gets out of step with the flat files is when something other than tCMS put them
  13. there.
  14. =head2 USAGE
  15. bin/build_index.pl
  16. Takes no arguments, and must be run from the tCMS root, as the data paths in
  17. the configuration are relative to it.
  18. Safe to re-run; it rebuilds from scratch rather than adding to what's there.
  19. =cut
  20. my $conf = Trog::Config::get();
  21. my $search = Trog::Data->new($conf);
  22. Trog::SQLite::TagIndex::build_index($search);
  23. Trog::SQLite::TagIndex::build_routes($search);