Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUCENE-9349: TermInSetQuery should use consumeMatchingTerms in visit() #1465

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

romseygeek
Copy link
Contributor

TermInSetQuery currently iterates through all its prefix-encoded terms
in order to build an array to pass back to its visitor when visit() is called.
This seems like a waste, particularly when the visitor is not actually
consuming the terms (for example, when doing a clause-count check
before executing a search). This commit changes TermInSetQuery to use
consumeTermsMatching(), and also changes the signature of this method so
that it takes a BytesRunAutomaton supplier to allow for lazy instantiation. In
addition, IndexSearcher's clause count check wasn't counting leaves that
called consumeTermsMatching().

@romseygeek
Copy link
Contributor Author

This will also make FuzzyQuery's visit() method nicer if we switch back to not holding its automaton directly on the query.

@mkhludnev
Copy link
Member

ok. +1

@romseygeek romseygeek merged commit 267d70b into apache:master Apr 29, 2020
@romseygeek romseygeek deleted the visitor/automaton branch April 29, 2020 09:19
asfgit pushed a commit that referenced this pull request Apr 29, 2020
#1465)

TermInSetQuery currently iterates through all its prefix-encoded terms
in order to build an array to pass back to its visitor when visit() is called.
This seems like a waste, particularly when the visitor is not actually
consuming the terms (for example, when doing a clause-count check
before executing a search). This commit changes TermInSetQuery to use
consumeTermsMatching(), and also changes the signature of this method so
that it takes a BytesRunAutomaton supplier to allow for lazy instantiation.
MarcusSorealheis added a commit to MarcusSorealheis/lucene-solr that referenced this pull request Apr 30, 2020
* upstream/master:
  SOLR-14237: Fix HDFS nightly test failure
  LUCENE-9278: concatenate paths for sourcepath using path separator rather than whitespace (which causes invalid option to be passed to javadoc).
  LUCENE-9333: Add gradle task to compile changes.txt to a html (apache#1468)
  update CHANGES for apache#807
  Fix tests to survive nightly runs with many documents
  SOLR-14173: Don't use JQuery-Slim as it breaks the sidebar sub-menu system.
  SOLR-14237: A new panel with security info in admin UI's dashboard
  SOLR-14237: A new panel with security info in admin UI's dashboard
  LUCENE-7788: fail precommit on unparameterised log messages and examine for wasted work/objects
  SOLR-14173: Change left nav item highlighting to fix menu jumpiness when hovering/selecting
  LUCENE-9349: TermInSetQuery should use consumeMatchingTerms in visit() (apache#1465)
  LUCENE-9089: update FST usage example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants