Query class with query expansion methods moved off RailsNlp.