I have a custom search index.
Now search index is working but when I add a culture condition it returns null.
Here is a part of index where I set culture field:
var documentParameters = new SearchDocumentParameters
{
Index = srchInfo,
Type = SearchHelper.CUSTOM_SEARCH_INDEX,
Id = Guid.NewGuid().ToString(),
Created = DateTime.Now,
SiteName = currentSiteName,
Culture = siteCulture.CultureCode
};
And part of combining search query:
var searchCondition = culture != null
? SearchSyntaxHelper.GetFieldCondition("_culture", culture.ToLower(), true)
: "";
var condition = new SearchCondition(searchCondition, SearchModeEnum.AnyWord,
SearchOptionsEnum.FullSearch);
As a result I get a query like: "+_culture:en-gb +_customfield:(term1 OR term2)"
This query will return null, but if I remove +_culture:en-gb
then it will return all items(fro all cultures) according to customfield condition.
I have to add that search documents have field "_culture" field.
How can I include filter by culture?