Skip to content

Allow doc-values only search on keyword fields#82846

Merged
ywelsch merged 4 commits intoelastic:masterfrom
ywelsch:keyword-doc-values-search
Jan 24, 2022
Merged

Allow doc-values only search on keyword fields#82846
ywelsch merged 4 commits intoelastic:masterfrom
ywelsch:keyword-doc-values-search

Conversation

@ywelsch
Copy link
Copy Markdown
Contributor

@ywelsch ywelsch commented Jan 20, 2022

Similar to #82409, but for keyword fields.

Allows searching on keyword fields when those fields are not indexed (index: false) but just doc values are enabled.

This enables searches on archive data, which has access to doc values but not index structures. When combined with searchable snapshots, it allows downloading only data for a given (doc value) field to quickly filter down to a select set of documents.

Relates #81210 and #52728

@ywelsch ywelsch added :Search/Search Search-related issues that do not fall into other categories >enhancement labels Jan 20, 2022
@ywelsch ywelsch marked this pull request as ready for review January 20, 2022 12:45
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jan 20, 2022
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (Team:Search)

@ywelsch ywelsch requested a review from javanna January 20, 2022 12:45
@ywelsch ywelsch mentioned this pull request Jan 20, 2022
32 tasks
@ywelsch ywelsch merged commit fd7f69c into elastic:master Jan 24, 2022
@ywelsch
Copy link
Copy Markdown
Contributor Author

ywelsch commented Jan 24, 2022

Thanks @jpountz!

super(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta);
}

protected boolean allowDocValueBasedQueries() {
Copy link
Copy Markdown
Contributor

@javanna javanna Jan 24, 2022

Choose a reason for hiding this comment

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

I was wondering about this new method: I initially thought this is an additional user knob to turn doc_value queries on and off, based on its naming (similar to allow expensive queries). I think I misunderstood and it only has to do with the fact that some field types that inherit from TermBasedFieldType don't support docvalue based queries, correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I changed my mind on this one while working on a follow-up. It disappears actually in the follow-up, see #82925 (wait with review until full CI run). I was expecting some reuse in follow-ups, but that turned out more difficult, so I removed this extra abstraction

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

++ sounds good thanks I will have a look when ready for review.

@ywelsch ywelsch mentioned this pull request Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement release highlight :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants