-
Notifications
You must be signed in to change notification settings - Fork 25.7k
ESQL: Push == to text fields to lucene
#130387
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
Open
nik9000
wants to merge
22
commits into
elastic:main
Choose a base branch
from
nik9000:esql_push_bare_text
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fcf243a
WIP
nik9000 450d81f
Merge branch 'main' into esql_push_bare_text
nik9000 0c0f77e
Name
nik9000 3e3e5e6
More
nik9000 b9b7105
Merge branch 'main' into esql_push_bare_text
nik9000 e769c32
Compile
nik9000 4d6bba5
t Merge branch 'main' into esql_push_bare_text
nik9000 a522cb9
Merge branch 'main' into esql_push_bare_text
nik9000 07f92d7
Explain
nik9000 8959080
Fixup
nik9000 f432dd3
Merge branch 'main' into esql_push_bare_text
nik9000 6e519cd
Update docs/changelog/130387.yaml
nik9000 0a24912
[CI] Auto commit changes from spotless
d3ea0f0
Merge branch 'main' into esql_push_bare_text
nik9000 b63a626
Fixup
nik9000 5603252
Merge remote-tracking branch 'nik9000/esql_push_bare_text' into esql_…
nik9000 ad4f407
Merge branch 'main' into esql_push_bare_text
nik9000 b5e91c8
Merge branch 'main' into esql_push_bare_text
nik9000 0c1efa5
Fixup
nik9000 4b30b5b
Merge remote-tracking branch 'nik9000/esql_push_bare_text' into esql_…
nik9000 96060ec
Off by one fun
nik9000 57702c6
Merge branch 'main' into esql_push_bare_text
nik9000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 130387 | ||
| summary: Push `==` to `text` fields to lucene | ||
| area: ES|QL | ||
| type: enhancement | ||
| issues: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==SEARCH FOLKS LOOK HERE==
Is this paranoid enough? Like, could you break the
matchquery with other settings I'm not checking? I'd love to default this to only working if there's nothing configured on the text field and then opt in configurations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is paranoid indeed. Just checking if the analyzer are the same is not enough since we have morphological analyzer that can tokenize differently depending on the surrounding text (Kuromoji, Nori, ..).
We could have a list of
allowedanalyzers but that sounds like a good start that will handle 99% of the use cases.I can't think of another setting that would change this, are we matching the input as phrase query or as a conjunction of term?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conjunction of terms right now. I probably should do phrase to be honest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's worth building a field setting that overrides our choices? A
true/false/nullthing -truemeans "I know match is fine, push",falsemeans "I know match isn't fine, never push" andnullmeans "you figure it out".Can you give an example? So long as the same text tokenizes the same way that should be fine. We're not pushing "contains tokens" here - we're pushing exat string ==.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right sorry, the input must be exactly the same. So then another test, to remove the analyzer restriction, would be to use a memory index and verify that the search analyzer query can find the input indexed with the index analyzer?
I wonder if that should be pushed down to mappings directly. We have
termQuery,phraseQuerydefined by the field mappers now so we could delegate the decision there with anexactQuery? That would help with fields likematch_only_textto avoid doing two verifications on the content?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @javanna
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ESQL might indeed deserve some more query methods on
MappedFieldType. I've been adding methods to, like,TextFieldMapperthat help me decide what query to build. But I think it'd be cleaner to put these into theMappedFieldType. Also, it'd be more possible for, well, more fields to link into ESQL.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, I follow high-level. Sounds like it would be cleaner to add the query generation to MappedFieldType. I am not quite sure what the default generated query would be though, but that's an implementation detail. I am also not clear on how that same method may be used in match only text, not familiar enough with it, but it all sounds like a good idea.