SQLServerには次のストアドプロシージャがあります。
ALTER PROCEDURE [dbo].[FullTextSearchOnContent]
(
@SearchText NVARCHAR(200),
@LanguageId INT ,
@ContentStatusId INT ,
@ResultCount INT
)
AS
BEGIN
SET FMTONLY OFF;
SET NOCOUNT ON;
IF (@SearchText IS NULL) OR (@SearchText = '') OR (@ResultCount IS NULL) OR (@ResultCount = 0) RETURN NULL;
SELECT DISTINCT TOP(@ResultCount)
C.Id AS ContentId, C.ImagePath AS ContentImagePath, C.IsSpecial,C.LanguageId,C.LockCommenting,C.RegistrationDate AS ContentRegistrationDate,C.StatusId AS ContentStatusId,C.Summary,C.Title,C.VisitNumber,C.AllTagsString,
CS.FarsiName AS ContentStatusFarsiName,
U.Id As UserId,U.InitialReputation AS UserInitialReputation,U.IsAdmin AS IsUserAdmin,U.FullName AS UserFullName,U.PhotoPath AS UserPhotoPath,U.RoleId AS UserRoleId,U.UserStatusId AS UserStatusId
--,T.Id AS TagId, T.Name AS TagName
FROM Content AS C
INNER JOIN [User] AS U ON U.Id = C.WriterId
INNER JOIN [Subject] AS S ON S.Id = C.SubjectId
INNER JOIN [ContentStatus] AS CS ON CS.Id = C.StatusId
--INNER JOIN (SELECT DISTINCT * FROM Tag AS T
-- INNER JOIN TagContent AS TC ON TC.TagId=T.Id)
-- AS T ON T.ContentId = C.Id
WHERE C.LanguageId = @LanguageId AND C.StatusId=@ContentStatusId AND CONTAINS((C.Title,C.AllTagsString),@SearchText) ORDER BY C.RegistrationDate DESC
END
一部の列の全文検索に使用されます。
EF5で使いたいのですが、必ず返されますint
!
Entity Framework 5でどのように使用できますか?
編集 :
Get Column Information
ボタンをクリックしても何も起こらないので、comlexタイプを生成できませんでした。