Our Developer’s guide describes how to create smart search indexes using the API. With the exception of the Document crawler index type, you can set a value of the newIndex.IndexType property from PredefinedObjectType enumerator.
For example: newIndex.IndexType = PredefinedObjectType.DOCUMENT;
However, the document crawler index type specifically needs to be set like this:
newIndex.IndexType = SearchHelper.DOCUMENTS_CRAWLER_INDEX;
So, a complete API example would look like:
// Create new search index object
SearchIndexInfo newIndex = new SearchIndexInfo();
// Set the properties
newIndex.IndexDisplayName = "My new index";
newIndex.IndexName = "MyNewIndex";
newIndex.IndexIsCommunityGroup = false;
newIndex.IndexType = SearchHelper.DOCUMENTS_CRAWLER_INDEX;
newIndex.IndexAnalyzerType = AnalyzerTypeEnum.StandardAnalyzer;
newIndex.StopWordsFile = "";
// Save the search index
SearchIndexInfoProvider.SetSearchIndexInfo(newIndex);