Skip to content

Support autocomplete indexes on select fields #2671

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

Closed
Downchuck opened this issue Feb 21, 2013 · 6 comments
Closed

Support autocomplete indexes on select fields #2671

Downchuck opened this issue Feb 21, 2013 · 6 comments

Comments

@Downchuck
Copy link

The LinkedIn Cleo project provides type-ahead indexes on set fields, a very handy feature for certain circumstances. This has come up for me in a project where one of the fields is essentially a dynamic enumeration of about five thousand entries; names of people and companies and the like. The Cleo project is available under Apache 2.0, should ES authors see fit to borrow any of its components to fulfill this feature request. ES already has its own Bloom implementation.

An auto-complete search request would allow me to say field X must equal "Z" and field "Y" is the field which I'm running the auto-complete request on.

Example record: { assigned_rep: "Bob", company: "Tractor mowing", company_tokens: ["tractor","mowing","lawn"] }.

My search index would be on assigned_rep and company_tokens. I would pass assigned_rep = Bob and autocomplete_search on company_tokens for "Law", which would match on "lawn" and return the full record (and any other matches).

@Downchuck
Copy link
Author

This has been brought up before on mailing lists. The best post I found was Cleo or ElasticSearch with NGram. With the new patch from issue #2674, this feature is very close to supportable. It's likely that a few borrowings from the Cleo codebase would finish the feature.

@Downchuck
Copy link
Author

@Downchuck
Copy link
Author

Some of the API for issue #2709 may be relevant.

@Downchuck
Copy link
Author

It seems like performance issues partly addressed by issue #988 improvements in Lucene. Simply, bool.must.wildcard on a lowercase filtered + camel case analyzed field works quite well over a medium sized set of documents.

@kimchy
Copy link
Member

kimchy commented Mar 6, 2013

@Downchuck another option is to simply use edge ngrams analysis on the relevant field you wish to do autocomplete on.

@Downchuck
Copy link
Author

ES has this thoroughly handled, closing the bug.

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

No branches or pull requests

2 participants