apache / apache/lucene

Make analyzing suggester more flexible [LUCENE-4491]

Open
#5,557 11 comments 0 reactions 1 assignee Claimed by @s1monw View on GitHub
affects-version:4.1 legacy-jira-fix-version:4.9 legacy-jira-fix-version:6.0 legacy-jira-priority:Major type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Today we have a analyzing suggester that is bound to a single key. Yet, if you want to have a totally different surface form compared to the key used to find the suggestion you either have to copy the code or play some super ugly analyzer tricks. For example I want to suggest "Barbar Streisand" if somebody types "strei" in that case the surface form is totally different from the analyzed form.

Even one step further I want to embed some meta-data in the suggested key like a user id or some type my surface form could look like "Barbar Streisand|15". Ideally I want to encode this as binary and that might not be a valid UTF-8 byte sequence.

I'm actually doing this in production and my only option was to copy the analyzing suggester and some of it's related classes.

---
Migrated from [LUCENE-4491](https://issues.apache.org/jira/browse/LUCENE-4491) by Simon Willnauer (@s1monw), 1 vote, updated May 09 2016
Attachments: [LUCENE-4491.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-4491/LUCENE-4491.patch) (versions: 2)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.