Also removed the `id_cache` option from the clear cache api. Closes #5269
This commit makes queries and filters parsed the same way using the QueryParser abstraction. This allowed to remove duplicate code that we had for similar queries/filters such as `range`, `prefix` or `term`.