Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full Text Search on SQL Azure [duplicate]

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.

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

like image 466
JavaScript Developer Avatar asked Jun 11 '12 18:06

JavaScript Developer


People also ask

Does Azure SQL support Full-Text Search?

Full-Text Search is available in Premium, Standard and Basic service tiers in Azure SQL Database V12. You can start using it immediately on your databases as there is no other service configuration necessary.

How do I do a Full-Text Search in SQL?

For a full-text index to be created on a table, the table must have a single, unique nonnull column. You can build a full-text index on columns of type char, varchar, nchar, nvarchar, text, ntext, image, xml, varbinary, and varbinary(max) can be indexed for full-text search.

How do I enable Full-Text Search in SQL Server?

SQL Server databases are full-text enabled by default. Before you can run full-text queries, however, you must create a full text catalog and create a full-text index on the tables or indexed views you want to search.

How do I find similar text in SQL?

The basic steps are: 1) Create a fulltext index over the column. This will tokenise each string (stremmers, splitters, etc) and let you search for 'LIKE THIS' strings. The disclaimer is that I've never had to use it but I think it can do what you want.


1 Answers

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

Based on your question a) is not possible however b) is possible using 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:

  1. Configure your Windows Azure Blob Storage
  2. Use Web or Worker Role to access you SQL Azure and then create the Index on Windows Azure Blob Storage
  3. Use the Indexed data stored at Windows Azure Blob Storage

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

like image 102
AvkashChauhan Avatar answered Oct 15 '22 10:10

AvkashChauhan