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 document-oriented completion suggester #14410

Merged
merged 11 commits into from
Nov 7, 2015

Conversation

areek
Copy link
Contributor

@areek areek commented Oct 31, 2015

Adds document-oriented completion suggester (see #10746), replacing the previous completion suggester implementation from master.

This PR contains the changes from feature/completion_suggester_v2 branch (#11740 and #13659). Apart from code simplifications and bug fixes, the only functional change this adds is a collector which collects top N documents instead of top N suggestions. This was needed to ensure suggestion with multiple contexts would count as one suggestion. The change is contained in CompletionSuggester.java.

The 2.x branch and 2.1 branch for this feature implements the new completion suggester in a bwc way and allows the old suggester to be used if
created in a previous version.

closes #10746

contexts = fieldType.getContextMappings().getNamedContexts(suggestDoc.getContexts());
}
// collect payloads
Map<String, List<Object>> payload = Collections.emptyMap();
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just initialize this with new HashMap<>() and make it final?

@mikemccand
Copy link
Contributor

LGTM, thanks @areek!

Nice to see we can now remove two forked Lucene classes, the custom postings format, and cutover to Lucene's impls instead.

@s1monw
Copy link
Contributor

s1monw commented Nov 4, 2015

I left two minor comments on the latest commits, this LGTM too and doesn't need another review. Please go ahead and merge after the comments are fixed

areek and others added 11 commits November 7, 2015 17:46
The completion suggester provides auto-complete/search-as-you-type functionality.
This is a navigational feature to guide users to relevant results as they are typing, improving search precision.
It is not meant for spell correction or did-you-mean functionality like the term or phrase suggesters.

The completions are indexed as a weighted FST (finite state transducer) to provide fast Top N prefix-based
searches suitable for serving relevant results as a user types.

closes elastic#10746
@areek areek force-pushed the completion_suggester_master branch from a644e0a to 6444194 Compare November 7, 2015 23:23
@areek areek removed the v2.1.0 label Nov 7, 2015
@areek areek merged commit 6444194 into elastic:master Nov 7, 2015
@djschny
Copy link
Contributor

djschny commented Nov 9, 2015

Was this prematurely merged? I'm still pretty concerned about removing the payloads ability the users have now without concrete numbers that show the speed is the same. See comments on #10746

@colings86 colings86 removed the v2.2.0 label Jan 22, 2016
@clintongormley
Copy link
Contributor

This was originally merged into 2.2, but has been backed out in #16170 and so is in master only.

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.

Completion Suggester V2
6 participants