stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";// Creating an indexIndexindex=newIndex(indexFolder);// Subscribing to the eventindex.Events.FileIndexing+=(sender,args)=>{if(args.DocumentFullPath.EndsWith("Protected.pdf",StringComparison.InvariantCultureIgnoreCase)){args.AdditionalFields=newDocumentField[]{newDocumentField("Tags","Protected")};}if(!args.DocumentFullPath.ToLowerInvariant().Contains("important")){args.SkipIndexing=true;}};// Indexing documents from the specified folderindex.Add(documentsFolder);