We are using Azure search. This is a website search. End user enters the keyword and the pages where it is present in the content, are returned as search results.
The functionality works fine when the page is browsed in the English version and the keyword is in English, but Thai-Thai is not working.
Is there any particular way to index the content for a multi-lingual site.
string index = string.Format("sitecore_{0}_index", Context.Database.Name.ToLower());
using (var context = ContentSearchManager.GetIndex(index).CreateSearchContext())
{
IQueryable<SearchResultItem> query = context.GetQueryable<SearchResultItem>()
.Where(x => x.Paths.Contains(ID.Parse(SitecoreUtility.GetHomeItem().ID)) &&
x.Content.Contains(keywords) && x.Language == Sitecore.Context.Language.Name);
if (query != null && query.Count() > 0)
{
//process search result
}
}
I have followed the solution here to build the _content field value.
The if
condition fails for Thai search.
So, I modified it and found out that it actually returns no results for this:
IQueryable<SearchResultItem> querytest = context.GetQueryable<SearchResultItem>()
.Where(x => x.Paths.Contains(ID.Parse(SitecoreUtility.GetHomeItem().ID)) &&
x.Language == Sitecore.Context.Language.Name);
I'm only searching for page items that are under the "Home" item. Does it mean, the Thai page items werent indexed.
Using Sitecore 8.2 version 3