I wrote a test for this (with constant score query with filter but without query) and it's no problem as the method does something only `if query instanceof SomeQuery`.