By default, Sitecore use "Lucene.Net.Analysis.Standard.StandardAnalyzer" and you can find it in wbe.config.(/configuration/sitecore/search/analyzer)
We create a new custom Analyzer inherit from "standardAnalyzer" and override the constructor. Here is the place I assign my own custom stop words to "STOP_WORDS_SET"
public class CustomAnalyzer : Lucene.Net.Analysis.Standard.StandardAnalyzer { private static ISetSTOP_WORDS_SET = GetStopWords();//{{"by","by"}}; <-- Makes "by" a public CustomAnalyzer() : base(Lucene.Net.Util.Version.LUCENE_30, STOP_WORDS_SET) { } private static ISet GetStopWords() { string[] strArray = GetWords(); CharArraySet set = new CharArraySet(strArray.Length, false); set.AddAll((IEnumerable )strArray); return (ISet )CharArraySet.UnmodifiableSet(set); } }
After, under "/configuration/sitecore/search/analyzer" in web.config, we wire the custom analyzer as below,
Lucene_30
Don't forget to register it from you custom index file
Done!!!
wonderful information, I had come to know about your blog from my friend nandu , hyderabad,i have read atleast 7 posts of yours by now, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanks a ton once again,
ReplyDeleteRegards, sitecore training in hyderabad
I would like to say that this blog really convinced me to do it! Thanks, very good post. custom strapback hats
ReplyDeleteWe do custom patches, embroidered patches, printed patches, custom Velcro patches, clothing labels, PVC patches, custom leather patches, custom keychains, and other promotional products. Following is an overview of our products. Custom Iron On Patches
ReplyDeleteI am incapable of reading articles online very often, but I’m happy I did today. It is very well written, and your points are well-expressed. I request you warmly, please, don’t ever stop writing. handmade leather crossbody bag
ReplyDelete