create query struct
use word index instead of trie for searching