SQL Azure上的全文搜索[重复]

时间:2022-03-09 10:37:10

This question already has an answer here:

这个问题在这里已有答案:

I have a database that I am migrating to SQL Azure. There are a couple of stored procedures in this database that rely on ContainsTable. From my understanding, SQL Azure does not support this. Because of this, I was hoping there would be a way to imitate this functionality in C# code.

我有一个数据库,我正在迁移到SQL Azure。此数据库中有几个依赖于ContainsTable的存储过程。根据我的理解,SQL Azure不支持这一点。因此,我希望有一种方法可以在C#代码中模仿这个功能。

Does anyone know how to either: a) Utilize ContainsTable in SQL Azure or b) Imitate it in C# code?

有谁知道如何:a)在SQL Azure中使用ContainsTable或b)用C#代码模仿它?

1 个解决方案

#1


20  

Yes, you are right that Contains Table are not supported on SQL Azure as described here.

是的,您是正确的,SQL Azure不支持包含表,如此处所述。

Based on your question a) is not possible however b) is possible using Lucene.NET.

基于你的问题a)是不可能的,但b)可以使用Lucene.NET。

IF you wish to use code to get full text search in SQL Azure you would need to use Lucene.net in a web or worker role to index your SQL Azure data to Windows Azure Blob storage and then access the indexed data to search. The process is described as below:

如果您希望使用代码在SQL Azure中进行全文搜索,则需要在Web或辅助角色中使用Lucene.net将SQL Azure数据编入索引到Windows Azure Blob存储,然后访问要搜索的索引数据。该过程描述如下:

  1. Configure your Windows Azure Blob Storage
  2. 配置Windows Azure Blob存储
  3. Use Web or Worker Role to access you SQL Azure and then create the Index on Windows Azure Blob Storage
  4. 使用Web或辅助角色访问SQL Azure,然后在Windows Azure Blob存储上创建索引
  5. Use the Indexed data stored at Windows Azure Blob Storage
  6. 使用存储在Windows Azure Blob存储中的索引数据

Here is an article to start your work: How to Use Lucene.NET with SQL Azure (en-US)

这是一篇开始工作的文章:如何在SQL Azure中使用Lucene.NET(en-US)

#1


20  

Yes, you are right that Contains Table are not supported on SQL Azure as described here.

是的,您是正确的,SQL Azure不支持包含表,如此处所述。

Based on your question a) is not possible however b) is possible using Lucene.NET.

基于你的问题a)是不可能的,但b)可以使用Lucene.NET。

IF you wish to use code to get full text search in SQL Azure you would need to use Lucene.net in a web or worker role to index your SQL Azure data to Windows Azure Blob storage and then access the indexed data to search. The process is described as below:

如果您希望使用代码在SQL Azure中进行全文搜索,则需要在Web或辅助角色中使用Lucene.net将SQL Azure数据编入索引到Windows Azure Blob存储,然后访问要搜索的索引数据。该过程描述如下:

  1. Configure your Windows Azure Blob Storage
  2. 配置Windows Azure Blob存储
  3. Use Web or Worker Role to access you SQL Azure and then create the Index on Windows Azure Blob Storage
  4. 使用Web或辅助角色访问SQL Azure,然后在Windows Azure Blob存储上创建索引
  5. Use the Indexed data stored at Windows Azure Blob Storage
  6. 使用存储在Windows Azure Blob存储中的索引数据

Here is an article to start your work: How to Use Lucene.NET with SQL Azure (en-US)

这是一篇开始工作的文章:如何在SQL Azure中使用Lucene.NET(en-US)