Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel Jensen 29 posts 160 karma points
    Aug 29, 2016 @ 08:58
    Daniel Jensen
    0

    Searching for danish special characters in RTE text field

    Hi, I have a issue with my search in Umbraco. I'm using the Lucene Examine to do the search, and have set up IndexSets etc.

    The search works fine with words without danish letters ("æøå"). When doing a search with danish letters, it works on some pages (specific kind of documenttypes), but for one document type, it doesnt work.

    The content that i'm trying to search in, is from the RTE, which it also is, in the documenttypes that works.

    So i have a case where i can't search with danish special characters in a RTE field through Lucene Examine.

    It works with plain text and titles.

    My theory is that Lucene Examine somehow encodes the danish special characters in the cache (db data is saved with "æøå", unencoded), but this doesnt hold up, since it works in a RTE field on some document types.

    My search looks like this:

    String searchType;
    //Fetching our SearchProvider by giving it the name of our searchprovider
    if (t == "2")
    {
        searchType = "NewsOnlySearcher";
    
    }
    else if (t == "1")
    {
        searchType = "ContentOnlySearcher";
    }
    else//t==3
    {
        searchType = "FullSiteSearcher";
    }
    var Searcher = Examine.ExamineManager.Instance.SearchProviderCollection[searchType];
    
    //Searching and ordering the result by score, and we only want to get the results that has a minimum of 0.05(scale is up to 1.)
    var searchResultsFullList = Searcher.Search(q, true).OrderByDescending(x => x.Score).TakeWhile(x => x.Score > 0.00f);//0.05f
    var numberOfResults = searchResultsFullList.Count();
    

    Does anyone have a solution/seen a similar issue?

    Thanks in advance

Please Sign in or register to post replies

Write your reply to:

Draft