Use a more efficient query for batch indexing

Remove a WHERE clause from a query and let the in process filtering handle
the result.  This speeds up the query by two orders of magnitude on large
wikis.

Change-Id: I9e7724c59e5d4160580ca1cd4932e90b63b29ea7