public void Configure(string name, LuceneDirectoryIndexOptions options) { switch (name) { case Constants.UmbracoIndexes.InternalIndexName: options.Analyzer = new CultureInvariantWhitespaceAnalyzer(); options.Validator = _umbracoIndexConfig.GetContentValueSetValidator(); options.FieldDefinitions = new UmbracoFieldDefinitionCollection(); break; case Constants.UmbracoIndexes.ExternalIndexName: options.Analyzer = new StandardAnalyzer(LuceneInfo.CurrentVersion); options.Validator = _umbracoIndexConfig.GetPublishedContentValueSetValidator(); options.FieldDefinitions = new UmbracoFieldDefinitionCollection(); break; case Constants.UmbracoIndexes.MembersIndexName: options.Analyzer = new CultureInvariantWhitespaceAnalyzer(); options.Validator = _umbracoIndexConfig.GetMemberValueSetValidator(); options.FieldDefinitions = new UmbracoFieldDefinitionCollection(); break; } // ensure indexes are unlocked on startup options.UnlockIndex = true; if (_settings.LuceneDirectoryFactory == LuceneDirectoryFactory.SyncedTempFileSystemDirectoryFactory) { // if this directory factory is enabled then a snapshot deletion policy is required options.IndexDeletionPolicy = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy()); } }
private IIndex CreateMemberIndex() => new UmbracoMemberIndex( Constants.UmbracoIndexes.MembersIndexName, new UmbracoFieldDefinitionCollection(), CreateFileSystemLuceneDirectory(Constants.UmbracoIndexes.MembersIndexPath), new CultureInvariantWhitespaceAnalyzer(), _profilingLogger, _umbracoIndexConfig.GetMemberValueSetValidator());