wikipedia xml.sql 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -- drop table entries;
  2. -- drop table bigram;
  3. create table entries ( /* including articles, redirected articles and templates */
  4. seq bigint(15) not null auto_increment primary key,
  5. entry_type tinyint, /* 0 - article, 1 - redirected article, 2 - other */
  6. title varchar(255) COLLATE latin1_bin,
  7. title_search varchar(50), /* title for search (keeping only alphanumeric characters) */
  8. idx int, /* unique sequential index for articles */
  9. redirect_title varchar(255) COLLATE latin1_bin, /* title to rediret to */
  10. redirect_title_idx bigint(15), /* idx for title to redirect to */
  11. text_start_offset bigint(15), /* offset to the wiki XML file */
  12. text_len int default 0 /* article text length in the wiki XML file */
  13. ) MAX_ROWS=10000000, AVG_ROW_LENGTH=120;
  14. create table bigram (
  15. seq int not null auto_increment primary key,
  16. bigram_chars varchar(2) COLLATE latin1_bin,
  17. occurrences int default 0
  18. );
  19. create index idx_entries_idx on entries (
  20. idx
  21. );
  22. create index idx_entries_title on entries (
  23. title
  24. );
  25. create index idx_entries_search on entries (
  26. title_search
  27. );
  28. create index idx_entries_redirect on entries (
  29. redirect_title
  30. );
  31. create index idx_bigram_chars on bigram (
  32. bigram_chars
  33. );