mikemccand commented on PR #12310: URL: https://github.com/apache/lucene/pull/12310#issuecomment-1555415525
> Yeah we should explore a binary version. Even if it doesn't speedup TermInSetQuery. +1 > Pretty sure I added a comment along the lines of "we should not do this" Oh yeah! I think you are referring to this super scary code! ``` @Override public void visit(QueryVisitor visitor) { if (visitor.acceptField(field) == false) { return; } if (termData.size() == 1) { visitor.consumeTerms(this, new Term(field, termData.iterator().next())); } if (termData.size() > 1) { visitor.consumeTermsMatching(this, field, this::asByteRunAutomaton); } } // TODO: this is extremely slow. we should not be doing this. private ByteRunAutomaton asByteRunAutomaton() { TermIterator iterator = termData.iterator(); List<Automaton> automata = new ArrayList<>(); for (BytesRef term = iterator.next(); term != null; term = iterator.next()) { automata.add(Automata.makeBinary(term)); } Automaton automaton = Operations.determinize( Operations.union(automata), Operations.DEFAULT_DETERMINIZE_WORK_LIMIT); return new CompiledAutomaton(automaton).runAutomaton; } ``` We should indeed make a `BytesRefsToAutomaton`! I'll open a spinoff. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org