doc only query finished, not tested yet, move to refactor ranker first