Change some interface for query text and add some test.