-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Completion Suggester: Support returning documents with completions #13576
Completion Suggester: Support returning documents with completions #13576
Conversation
Support returning documents that are associated with a set of completions
I looked at this and I like the code but that PR is very delicate and big. I wonder if it would make more sense if we land the branch without this feature on 2.x and move this to 3.0. I think we can generally refactor how we fetch documents and reuse much code if we do it right. I don't know how others feel @mikemccand @clintongormley |
The change is indeed biggish ... If we land completion suggester for 2.1 without fetching docs (this PR), we've lost some functionality (payloads) vs the current suggester impls, right? Is that OK, or are payloads frequently used? If we do delay this PR, why would we need to delay fetching docs until 3.0? Couldn't we target e.g. 2.2 or something? |
the problem here is I guess that we can't really use this feature until we know all nodes support it otherwise you'd get partial results? The other option would be to return docs eagerly and don't do a second roundtrip which would be ok if fetching stuff from DocValues etc? |
Oh, I see, because a mixed minor version cluster is allowed... hrm.
This would simplify things greatly (not needing 2nd fetch phase), but then there's some perf hit since we're pulling docs/docvalues for many hits that we then throw away when we merge suggestions across all shards ... and I wonder how much of a perf hit we are talking about even w/ the 2nd fetch phase since the current suggesters pull payloads directly from the FST. |
I think what we should do is this:
WDYT? I discussed this briefly with @areek yesterday night already |
+1 to that plan. |
This makes sense. I am working on a PR to support fetching docvalues eagerly for 2.1. I will open up followup issues to do the cleanup/enhancement in master. |
I opened #13659 which implements docvalues based payload support for 2.1, would appreciate a review :)
@mikemccand I plan to benchmark #13659 against the current suggester payload support to try to shed some light on this |
@areek @s1monw @mikemccand wondering if we should get this in for 5.0? |
@clintongormley @s1monw @mikemccand I opened #17198, this will simplify adding document fetching to |
closed as functionality has been implemented in #19536 |
Note: the PR is against
feature/completion_suggester_v2
branchCurrently, the new completion suggester (#11740) can associate a document with a completion. This PR adds support to return documents enriched with their completions.
Example request:
Example response:
Source filtering options are supported.
Internally a suggestion request is represented as a search request implementing a two-phased suggest then fetch transport action for multiple shards and a single-phased suggest and fetch phase for single shard.
NOTE: the two-phased suggest transport action has yet to be integrated with the _search API