Pla 833

For SQL Review ( @SQLReview ):
code is in file SuggestionsIndexer.php, it's a maintenance script. Look at last three methods in the class:
getIDsRangeFromDB method might generate given sql (depends on range of page_ids given):
SELECT  page_id  FROM `page`  WHERE (page_id >= 10) AND (page_id <= 10000) AND (page_namespace = 0) AND (page_is_redirect = 0);
explain result:
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: page
         type: range
possible_keys: PRIMARY,name_title,page_redirect_namespace_len
          key: PRIMARY
      key_len: 4
          ref: NULL
         rows: 10536
        Extra: Using where
1 row in set (0.00 sec)

getIDsFromDB method will generate:
SELECT  page_id  FROM `page`  WHERE (page_namespace = 0) AND (page_is_redirect = 0);
explain result:
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: page
         type: ref
possible_keys: name_title,page_redirect_namespace_len
          key: page_redirect_namespace_len
      key_len: 5
          ref: const,const
         rows: 51744
        Extra: Using index
1 row in set (0.00 sec)

getMaxIDFromDB method will generate:
SELECT  max(page_id)  FROM `page`;
explain result:
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: NULL
         type: NULL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: NULL
        Extra: Select tables optimized away
1 row in set (0.00 sec)

Code for handling new search suggestions. Please take a look at fallback to old suggestions in case new one will fail. Don't merge yet. @macbre