Exemplo n.º 1
0
        private async Task CreateIndexInternalAsync(string indexName)
        {
            var result = await azureSearchEngine.CreateIndexAsync(indexName, field =>
            {
                foreach (var fieldInfo in ProductFieldInfo.SearchFields)
                {
                    field.Invoke(fieldInfo.Name, fieldInfo.Type, fieldInfo.IsKey, fieldInfo.IsSearchable, fieldInfo.IsFilterable, fieldInfo.IsSortable, fieldInfo.IsFacetable, fieldInfo.IsRetrievable);
                }
            },
                                                                  (callback =>
            {
                callback.Invoke(SuggesterName, new List <string>()
                {
                    "RowKey", "ProductName"
                });
            })
                                                                  , 5000);

            Assert.IsTrue(result);
        }
 private async Task CreateIndexInternalAsync(string distributorId)
 {
     var result = await azureSearchEngine.CreateIndexAsync(distributorId, field =>
     {
         foreach (var fieldInfo in AirportFieldInfo.SearchFields)
         {
             field.Invoke(fieldInfo.Name, fieldInfo.Type, fieldInfo.IsKey, fieldInfo.IsSearchable,
                          fieldInfo.IsFilterable, fieldInfo.IsSortable, fieldInfo.IsFacetable, fieldInfo.IsRetrievable);
         }
     },
                                                           (callback =>
     {
         callback.Invoke(suggesterName, new List <string>()
         {
             "Identifier", "City", "Name"
         });
     })
                                                           , 5000);
 }