In our Sitecore site we have a few 'English' languages:
We wanted to do a search using the
Lucene index (a custom one, but that doesn't actually matter) and included the language in it to get only results for the current language. But when we search on "en" we also get results for the other "en" based languages. When we search on "en-gb" we get nothing.
We tried Luke and got the same results. So I assumed the field would be tokenized and indeed, in the default Lucene config I found:
<field fieldName="_language" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"> <analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" /> </field>
This explained the behavior, but now I am wondering if we can search on language (when having multiple 'English' languages) without adding a custom field for this?