在多个表中搜索数据
Search data in multiple tables
比方说,我在 Azure 中有 2 个表 SQL – Employee & Address 并且两个表都有公共字段,比如 Address Id。
问题:
如果我为表创建单独的索引,我可以通过一次搜索来搜索两个索引中的数据吗API?是否可以加入 2 个索引?只是交叉检查是否存在此类功能。
我知道的另一个选择是——使用下面给出的解决方案将数据从两个表加载到单个索引。这只能通过 .NET API 实现吗?我们可以从 Portal 开发它吗?
https://docs.microsoft.com/en-us/azure/search/tutorial-multiple-data-sources
还有其他推荐的方法吗?
If I create separate indexes for tables, can I search the data in both
indexes from single search API? Is it possible to join 2 indexes? Just
cross checking if such functionality exists.
没有。搜索仅限于单个索引。您需要在客户端合并来自多个索引的搜索结果。
Another option I am aware of is – load data from both the tables to
single index using solution given in below. Is this possible only via
.NET API? Can we develop it from Portal?
您应该可以从门户网站进行操作。本质上,这个想法是创建两个数据源(每个 table 一个),两个索引器(每个数据源一个),并让这些索引器将数据填充到一个索引中。
另一个想法是创建一个数据库视图,将来自这两个 table 的数据结合起来,并将该视图用作索引的数据源。这样您就不必创建单独的数据源和索引器。
只需使用这个:
命名空间WebApplication1.Data
{
public class 所有学生
{
[钥匙]
public int Id { 得到;放; }
public string UserName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
}
}
比方说,我在 Azure 中有 2 个表 SQL – Employee & Address 并且两个表都有公共字段,比如 Address Id。
问题:
如果我为表创建单独的索引,我可以通过一次搜索来搜索两个索引中的数据吗API?是否可以加入 2 个索引?只是交叉检查是否存在此类功能。
我知道的另一个选择是——使用下面给出的解决方案将数据从两个表加载到单个索引。这只能通过 .NET API 实现吗?我们可以从 Portal 开发它吗? https://docs.microsoft.com/en-us/azure/search/tutorial-multiple-data-sources
还有其他推荐的方法吗?
If I create separate indexes for tables, can I search the data in both indexes from single search API? Is it possible to join 2 indexes? Just cross checking if such functionality exists.
没有。搜索仅限于单个索引。您需要在客户端合并来自多个索引的搜索结果。
Another option I am aware of is – load data from both the tables to single index using solution given in below. Is this possible only via .NET API? Can we develop it from Portal?
您应该可以从门户网站进行操作。本质上,这个想法是创建两个数据源(每个 table 一个),两个索引器(每个数据源一个),并让这些索引器将数据填充到一个索引中。
另一个想法是创建一个数据库视图,将来自这两个 table 的数据结合起来,并将该视图用作索引的数据源。这样您就不必创建单独的数据源和索引器。
只需使用这个:
命名空间WebApplication1.Data { public class 所有学生 { [钥匙] public int Id { 得到;放; }
public string UserName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
}
}