Rank: Advanced Member
Groups: Registered
Joined: 9/1/2010 Posts: 136
|
Is it possible to define alternate spellings for words, such as names, when the index is created? For example, we have an author whose last name is "Bellett." It is common for people to misspell it as "Bellet." Is there a way to indicate this to the index so they are treated as the same word?
Thanks!
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Yes, what you do is at search time provide Bellett as a lemma for Bellet. Please see Customization here http://keyoti.com/produc...ming%20And%20Lemmas.htm
Code: protected void Page_Load(object sender, EventArgs e)
{
Sr1.Configuration.CentralEventDispatcher.Action += new Keyoti.SearchEngine.Events.ActionEventHandler(CentralEventDispatcher_Action);
}
void CentralEventDispatcher_Action(object sender, Keyoti.SearchEngine.Events.ActionEventArgs e)
{
if (e.ActionData.Name == Keyoti.SearchEngine.Events.ActionName.GetWordVariations)
{
Keyoti.SearchEngine.DataAccess.Word theWord = ((object[])e.ActionData.Data)[0] as Keyoti.SearchEngine.DataAccess.Word;
ArrayList variations = (e.ActionData.Data as object[])[1] as ArrayList;
if (theWord.WordContent.ToLower() == "bellet")
{
variations.Insert(0, "Bellett");//insert a word we also want to search for
}
}
}
-your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
Rank: Advanced Member
Groups: Registered
Joined: 9/1/2010 Posts: 136
|
Looks like just what I need. Thanks!
|