This project is read-only.

Luecene Accents and LowerUpperCase

Topics: Customizing Orchard, Troubleshooting, Writing modules
May 14, 2014 at 5:34 PM
Edited May 14, 2014 at 5:35 PM

I have a content item with titlePart and BodyPart:

TitlePart: "Resolución de Precios"
BodyPart: "El año 2012 fue un período de importantes avances en nuestro compromiso social, económico y ambiental"

I want to be able to make successfully search hits for: resolucion, resolución, Resolución, RESOLUCION, RESOLUCIÓN, resolucion de precios, resolución de precios, ReSolucion de PRECIOS.

The same for queries on the bodyPart.

I am only getting hits for exact words.

I also found some kind of solution that i dont understand so much using this class: i added to the luceneindexprovider but it does not work, someone can point me to some solution?

Here is what i have found so far and it does not work well and i dont understand.

class MyAnalyzer : StandardAnalyzer
    public MyAnalyzer(Version LuceneVersion) : base(LuceneVersion) { }
    public override TokenStream TokenStream(string fieldName, TextReader reader)
        TokenStream result = new WhitespaceTokenizer(reader);
        result = new MyTokenFilter(result);
        result = new LowerCaseFilter(result);
        result = new ASCIIFoldingFilter(result);
        return result;