title: Sitecore custom index configure languages
body: <p>I created a custom Lucene index in a Sitecore 8.1 environment like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration xmlns:x="http://www.sitecore.net/xmlconfig/"&gt;
    &lt;sitecore&gt;
      &lt;contentSearch&gt;
        &lt;configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch"&gt;
          &lt;indexes hint="list:AddIndex"&gt;
            &lt;index id="Products_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider"&gt;
              &lt;param desc="name"&gt;$(id)&lt;/param&gt;
              &lt;param desc="folder"&gt;$(id)&lt;/param&gt;
              &lt;param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" /&gt;
              &lt;configuration ref="contentSearch/indexConfigurations/ProductIndexConfiguration" /&gt;
              &lt;strategies hint="list:AddStrategy"&gt;
                &lt;strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" /&gt;
              &lt;/strategies&gt;
              &lt;commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch"&gt;
                &lt;policies hint="list:AddCommitPolicy"&gt;
                  &lt;policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" /&gt;
                &lt;/policies&gt;
              &lt;/commitPolicyExecutor&gt;
              &lt;locations hint="list:AddCrawler"&gt;
                &lt;crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"&gt;
                  &lt;Database&gt;master&lt;/Database&gt;
                  &lt;Root&gt;/sitecore/content/General/Product Repository&lt;/Root&gt;
                &lt;/crawler&gt;
              &lt;/locations&gt;
              &lt;enableItemLanguageFallback&gt;false&lt;/enableItemLanguageFallback&gt;
              &lt;enableFieldLanguageFallback&gt;false&lt;/enableFieldLanguageFallback&gt;
            &lt;/index&gt;
          &lt;/indexes&gt;
        &lt;/configuration&gt;
  
        &lt;indexConfigurations&gt;
          &lt;ProductIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider"&gt;
            &lt;initializeOnAdd&gt;true&lt;/initializeOnAdd&gt;
            &lt;analyzer ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/analyzer" /&gt;
            &lt;documentBuilderType&gt;Sitecore.ContentSearch.LuceneProvider.LuceneDocumentBuilder, Sitecore.ContentSearch.LuceneProvider&lt;/documentBuilderType&gt;
            &lt;fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch"&gt;
              &lt;fieldNames hint="raw:AddFieldByFieldName"&gt;
                &lt;field fieldName="_uniqueid" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"&gt;
                  &lt;analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" /&gt;
                &lt;/field&gt;
                &lt;field fieldName="key" storageType="YES" indexType="UNTOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"/&gt;
              &lt;/fieldNames&gt;
            &lt;/fieldMap&gt;
            &lt;documentOptions type="Sitecore.ContentSearch.LuceneProvider.LuceneDocumentBuilderOptions, Sitecore.ContentSearch.LuceneProvider"&gt;
              &lt;indexAllFields&gt;true&lt;/indexAllFields&gt;
              &lt;include hint="list:AddIncludedTemplate"&gt;
                &lt;Product&gt;{843B9598-318D-4AFA-B8C8-07E3DF5C6738}&lt;/Product&gt;
              &lt;/include&gt;
            &lt;/documentOptions&gt;
            &lt;fieldReaders ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/fieldReaders"/&gt;
            &lt;indexFieldStorageValueFormatter ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/indexFieldStorageValueFormatter"/&gt;
            &lt;indexDocumentPropertyMapper ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration/indexDocumentPropertyMapper"/&gt;
          &lt;/ProductIndexConfiguration&gt;
        &lt;/indexConfigurations&gt;
      &lt;/contentSearch&gt;
    &lt;/sitecore&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Actually a quite straightforward index that points to a root, includes a template and stores a field. It all works. But I need something extra:</p>
  
  <ul>
  <li>Limit the entries in the index to the latest version </li>
  <li>Limit the entries in the index to one language (English)</li>
  </ul>
  
  <p>I know this can be easily triggered in the query as well, but I want to get my indexes smaller so they will (re)build faster.</p>
  
  <p>The first one could be solved by indexing web instead of master, but I actually also want the unpublished ones in this case. I'm quite sure I will need a custom crawler for this.</p>
  
  <p>The second one (limit the languages) is actually more important as I will also need this in other indexes. The easy answer is probably also to use a custom crawler but I was hoping there would be a way to configure this without custom code. Is it possible to configure an custom index to only include a defined set of languages (one or more) instead of all?</p>