Vulnerability in EPiServer.Forms
var client = SearchClient.Instance.Search();
var search = client
.InField(x => x.SearchTitle())
.AndInField(x => x.SearchText())
.Select(s => new SearchItem
Id = s.ContentLink.ID,
Title = s.SearchTitle(),
Excerpt = HighLight(s.SearchText(), query),
Url = s.ContentLink.GetUrl(language),
Type = s.PageTypeName
This is our current search. I want to make the search case insensitive, but I can't find any documentation on how I could do that.Closest I found was that I could do .Filter(x => x.Title.MatchCaseInsensitive("Find")), but this is a filter and not "inField" as we do it.
.Filter(x => x.Title.MatchCaseInsensitive(
)), but this is a filter and not "inField" as we do it.
We are running Find with simular query and it's not case sensitive.
I even checked unified search and it doesn't seem to be case sensitive either. Do you still have problems with this?
Hi,The .For(query)-statement is always case insensitive (and token delimited, i.e matches any token delimited by a breaking character (space, . , () just about any non letter or number). For example using .For("dog") will match "The dog ran outside".As for .Filter() they by default don't do any delimitation and only 'matches' complete strings. For example the only match for Filter(x => x.Title.Match("dog")) is "dog" (and not "Dog" or any string containing "dog" as in the example before). There are as you have found extensions to the Filter-match that can do for example case insensitive matches but all of these are just 'wider' matches of the core Filter-match.To sum it up think of .For() as a free text query in SQL and Filter() as the other Where clauses./Henrik