Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have a site in V8 with 2 languages.
I use Examine to make a search, like this
var results = searcher.CreateQuery("content").ManagedQuery(s).And().GroupedOr(new[] { "__NodeTypeAlias" }, new[] { "contentPage", "home" }).Execute();
But i get results from both the english and danish. Is there anyway to only search one of the lanuages, so when a user search form the danish site, only danish results show up, and the same for the english?
Best regards
Hi Jimmy,
The simple answer is yes, the complex answer is, you need to explicitly specify the fields to search in to limit the search to those explicit fields.
Nik
Thanks Nik
I ended up doing something like this
var currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString().ToLower(); var textFields = new[] { "midterGrid.Indhold_" + currentCulture, "venstreGrid.Indhold_" + currentCulture, "hojreGrid.Indhold_" + currentCulture }; var results = searcher.CreateQuery("content").GroupedOr(new[] { "__NodeTypeAlias" }, new[] { "contentPage", "home" }).And().GroupedOr(textFields, s).Execute();
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Search Examine only get results from current language
Hi,
I have a site in V8 with 2 languages.
I use Examine to make a search, like this
But i get results from both the english and danish. Is there anyway to only search one of the lanuages, so when a user search form the danish site, only danish results show up, and the same for the english?
Best regards
Hi Jimmy,
The simple answer is yes, the complex answer is, you need to explicitly specify the fields to search in to limit the search to those explicit fields.
Nik
Thanks Nik
I ended up doing something like this
is working on a reply...