Script for creating local docs from query logs