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

Phonetic Filter : Double Metaphone, partial implementation (not using the secondary code) #924

Closed
jmorille opened this issue May 11, 2011 · 3 comments

Comments

@jmorille
Copy link

Hello,

Like Wikipedia Double Metaphone description say (http://en.wikipedia.org/wiki/Double_Metaphone#Double_Metaphone)
"
It is called "Double" because it can return both a primary and a secondary code for a string;
For example, encoding the name "Smith" yields

  • a primary code of SM0
  • and a secondary code of XMT,
    while the name "Schmidt" yields a primary code of XMT and a secondary code of SMT--both have XMT in common.
    "

In https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/phonetic/PhoneticFilter.java

The PhoneticFilter only use only the primary code but not the secondary code

For using the secondary you have to use doubleMetaphone(String value, boolean alternate)
with alternate=false for secondary code
cf http://commons.apache.org/codec/api-release/org/apache/commons/codec/language/DoubleMetaphone.html

The question is how to use this seconday code ?

  • May be like a synonym way ?

Best regards

Jérome

@kimchy
Copy link
Member

kimchy commented May 11, 2011

Maybe we can implement an expliciit lucene filter for double metaphone that generates both tokens?

@jmorille
Copy link
Author

@kimchy
Copy link
Member

kimchy commented May 11, 2011

I see, will add it.

@kimchy kimchy closed this as completed in aa97308 May 11, 2011
ofavre pushed a commit to yakaz/elasticsearch that referenced this issue Jul 18, 2011
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants