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

Add FieldExpansionIterator that replaces the ANYFIELD scanner #2660

Open
wants to merge 9 commits into
base: integration
Choose a base branch
from

Conversation

apmoriarty
Copy link
Collaborator

Add iterator that expands fields for literal values.

if (date.compareTo(startDate) < 0) {
// advance to start date
log.trace("Key before start date: {} < {}", date, startDate);
return new FilterResult(false, AdvanceResult.NEXT);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a NEXT_CQ ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of NEXT_CQ maybe this should be a custom hint that triggers a seek to the start date..

public FieldExpansionIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, String term, Set<String> fields,
ExecutorService execService) {
super(config, scannerFactory, true, execService);
this.term = term.toLowerCase();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why lower case here? normalizers do not necessarily lower case values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right you are...I need to revisit this case. The previous implementation was doing a just-in-time expansion for normalization which implies the ExpandMultiNormalizedTerms doesn't handle unfielded terms well..

}

if (datatypes != null && !datatypes.contains(parser.getDatatype())) {
// figure out if we are before the first datatype -- seek to first datatype
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment does not seem relevant here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we seek to the next datatype?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the structure of the shard index keys a seek based on the datatype is never practical. I'll correct the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants