added encoder to index. created query tree structure