Examine CreateQuery with GroupedOr: problems with accents
I have a field that is a multiple option dropdown with some options containing words with french accents. Ex: ["Éducation Préscolaire", "Garde Scolaire"]
When I run code that uses Examine search with GroupedOr on the field for "Éducation Préscolaire", the search returns nothing.
However running ExternalIndex search in the backoffice for "Éducation Préscolaire" returns the expected results and more confusingly the code search now returns the expected results until the server is reset or I rebuild the project.
Here's a simplified code snippet of the Examine search
if (ExamineManager.Instance.TryGetIndex("ExternalIndex", out var index))
{
var filterGrades = ["Éducation Préscolaire"]; //This returns empty result. While ["Garde Scolaire"] returns expected results.
var searcher = index.GetSearcher();
var onlineResources = searcher.CreateQuery("content")
.ParentId(postModel.ContentId)
.And().GroupedOr(new[] { "resourceGrade" }, filterGrades);
var contentChildren = onlineResources.Execute().Select(s => Umbraco.Content(s.Id));
}
I'm guessing that once I run the backoffice search the Examine result is cached and the code search is able to get the correct result from that cache. But how is it that searches for options without accents work normally?
Examine CreateQuery with GroupedOr: problems with accents
I have a field that is a multiple option dropdown with some options containing words with french accents. Ex: ["Éducation Préscolaire", "Garde Scolaire"]
When I run code that uses Examine search with GroupedOr on the field for "Éducation Préscolaire", the search returns nothing.
However running ExternalIndex search in the backoffice for "Éducation Préscolaire" returns the expected results and more confusingly the code search now returns the expected results until the server is reset or I rebuild the project.
Here's a simplified code snippet of the Examine search
I'm guessing that once I run the backoffice search the Examine result is cached and the code search is able to get the correct result from that cache. But how is it that searches for options without accents work normally?
is working on a reply...