Example #1
0
 private static async Task <bool> CreateIndexer()
 {
     Console.WriteLine("Creating Indexer...");
     try
     {
         Indexer indexer = SearchResources.GetIndexer(IndexerName, DataSourceName, IndexName, SkillsetName);
         await _searchClient.Indexers.CreateAsync(indexer);
     }
     catch (Exception ex)
     {
         if (DebugMode)
         {
             Console.WriteLine("Error creating indexer: {0}", ex.Message);
         }
         return(false);
     }
     return(true);
 }
Example #2
0
 private static async Task <bool> CreateIndex()
 {
     Console.WriteLine("Creating Index...");
     try
     {
         Index index = SearchResources.GetIndex(IndexName, SynonymMapName);
         await _searchClient.Indexes.CreateAsync(index);
     }
     catch (Exception ex)
     {
         if (DebugMode)
         {
             Console.WriteLine("Error creating index: {0}", ex.Message);
         }
         return(false);
     }
     return(true);
 }
Example #3
0
 private static async Task <bool> CreateSkillSet()
 {
     Console.WriteLine("Creating Skill Set...");
     try
     {
         Skillset skillset = SearchResources.GetSkillset(SkillsetName, await KeyHelper.GetAzureFunctionHostKey(_httpClient), BlobContainerNameForImageStore);
         await _searchClient.Skillsets.CreateAsync(skillset);
     }
     catch (Exception ex)
     {
         if (DebugMode)
         {
             Console.WriteLine("Error creating skillset: {0}", ex.Message);
         }
         return(false);
     }
     return(true);
 }
Example #4
0
 private static async Task <bool> CreateSynonyms()
 {
     Console.WriteLine("Creating Synonym Map...");
     try
     {
         SynonymMap synonyms = SearchResources.GetSynonymMap(SynonymMapName);
         await _searchClient.SynonymMaps.CreateAsync(synonyms);
     }
     catch (Exception ex)
     {
         if (DebugMode)
         {
             Console.WriteLine("Error creating synonym map: {0}", ex.Message);
         }
         return(false);
     }
     return(true);
 }
Example #5
0
 private static async Task <bool> CreateDataSource()
 {
     Console.WriteLine("Creating Data Source...");
     try
     {
         DataSource dataSource = SearchResources.GetDataSource(DataSourceName);
         await _searchClient.DataSources.CreateAsync(dataSource);
     }
     catch (Exception ex)
     {
         if (DebugMode)
         {
             Console.WriteLine("Error creating data source: {0}", ex.Message);
         }
         return(false);
     }
     return(true);
 }