Patch, cutting over PrefixQuery to AutomatonQuery and removing
I explored the optimization of having Byte/CharRunAutomaton.run
optimize (short-circuit) when you're in a sink state but it became
quite difficult/invasive fixing all callers of .step to handle this.
LUCENE-5879 we also need to know the sink state under-the-hood,
but that's separate from fixing .run to make use of it.
So I backed out that opto and tried just doing the PrefixQuery cutover
without optimizing for sink states. I'm running a perf test w/
luceneutil and it looks like the impact is trivial (well within
noise). Net/net I think it's fine to "just cutover" without the
I also changed PrefixQuery's semantics to apply to full binary space
terms, not just UTF-8 space. While this is technically a change in
behavior, it won't impact users who index only unicode terms. It's
also necessary for
LUCENE-5879, because if prefixing is done only in
unicode space (like today), then the resulting binary space automaton
will not have a sink state and auto-prefix can't apply.
If this part is somehow controversial I can revert and try to do it
LUCENE-5879 instead... if it's OK, I'll add some tests
showing that PrefixQuery on binary terms works.