开发者

SQL Azure - Substring Searches?

开发者 https://www.devze.com 2023-01-11 00:14 出处:网络
SQL Azure does not support SQL Server\'s Full Text Search feature. Does this mean a text field cannot be indexed to handle substring searches?

SQL Azure does not support SQL Server's Full Text Search feature. Does this mean a text field cannot be indexed to handle substring searches?

For example, if I have a table Emails, with a Message column And I want to find all messages with both the words 'hello' and 'thanks' in them, will the standard index on the message collumn allow me 开发者_如何学Goto do this?

CREATE TABLE Emails (
    [Id] bigint  NOT NULL,
    [Message] nvarchar({some number})  NOT NULL
);
GO

CREATE NONCLUSTERED INDEX Messages_Emails ON Emails


my query (using entity) would look like
var niceMessageQuery = Context.Emails.Where(e => e.Message.Contains("hello") && e.Message.Contains("thanks"));

Is there a better way to setup this query?


As of April 2015 Full-Text Search is available in Azure Sql Database server version V12: http://azure.microsoft.com/blog/2015/04/30/full-text-search-is-now-available-for-preview-in-azure-sql-database/.


Not familiar at all with azure, but is it possible to use a subquery? The inner (sub) query find all records that contain "hello" and the outer query uses that inner query as it's dataset to search for "thanks"?

0

精彩评论

暂无评论...
验证码 换一张
取 消