Document thread identification