Fix issue due to missing type attribute when having only a synonym filter and the synonym list is empty

Try using a LinkedHashset instead of TreeSet to preserve the order of token in a given position.