Copied to clipboard

Flag this post as spam?

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


  • KyleEales 1 post 21 karma points
    Jun 15, 2021 @ 07:55
    KyleEales
    0

    Umbraco Lucene search breaking on 'special characters'

    When a user inputs certain special characters i.e a html tag, the user receives this:

    Error loading Partial View script (file: ~/Views/MacroPartials/ezSearch.cshtml)

    I have been investigating and this seems to be a common issue and I attempted to apply a fix so it would strip out 'bad' characters:

        public string CleanseSearchTerm(string input)
    {
        System.Text.RegularExpressions.Regex rgx = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9 -]");
        input = rgx.Replace(input, "");
    
        return input.ToString();
    }
    

    However, the issue is that this error is getting generated before it has a chance to hit my method to strip out 'bad' characters. Any ideas of how this can be resolved?

  • AddWeb Solution Pvt. Ltd 109 posts 360 karma points
    Jun 17, 2021 @ 05:35
    AddWeb Solution Pvt. Ltd
    0

    Hello,

    The issue may be two separate dlls are used and both are using SearchResult.

    Go to: Partial View Macro Files -> ezSearch

    In the bottom choose the one you want for ezSearch

Please Sign in or register to post replies

Write your reply to:

Draft