added builder of index by file or by index