c# - Tweaking my search functionality -
I have tested the functionality of searching on a live website. I came to some minor issues I used special characters in the search box Can not keep or my application crash I tried to solve it, using something using it to be replaced on crashed letters, but it will not cure pain when I put this sign: * I found the following error in the search box:
< P> '& lt; %%> echo; ':' 'or'? ' Wildcardy is not allowed in the form of first character. I was stripped of empty space before and after all this error. Then the error was gone, however, when I change it: * with it: "" I will get the error described above. Is there any standard way with which I can solve the special character issue? I'll write some of my code here, so I can get a better response. Analyst Analyzer = New Standard Analyst (); QueryParser qpContent = New Query Parser (Index.ContentFieldName, Analyzer); Keyword.Trim (); Keyword = keyword Place ("*", ""); Query QueryCentent = qpContent.Parse (Keyword + "*"); Place ("^", ""); Keywords = Keywords. Place ("^", ""); keyword = "); QuestionPerser qpLanguage = New Testpayers (" language ", analyzer); query query language = qpLanguage.Parse (Sitecore.Context.Language.Name.ToString ());
As You see that I change * for the first time and later add it to add it. I am not 100% familiar with this kind of functionality and therefore I I do not mind what I am doing. All help is highly appreciated, thanks!
A valid valid option may be set in your configuration, it helps to avoid injection attacks in asp.net.
Some details can be found here ...
And ...
Comments
Post a Comment