I have a below query, i do not have a fullName field , but queryText input can have fullname. my search by firstName or lastName works, but user provides both first and last name it does not work.
@queryText of
John Works
Doe Works
John Doe Does not work
CREATE FULLTEXT INDEX ON [HK].[User]
(
UserName,
FirstName,
LastName,
NickName,
EmailAddress,
WorkPhone
)
KEY INDEX [PK_HK.User]
ON [HKUserCatalog]
WITH CHANGE_TRACKING AUTO ,
STOPLIST = SYSTEM
;
GO
my sql
SELECT TOP(@queryLimit) * FROM [User]
WHERE
CONTAINS((UserName, FirstName, LastName, NickName, EmailAddress, WorkPhone), @queryText)
OR TRY_CONVERT(INT, @queryText) = UserId
Order By FirstName, LastName
;
How do i make it work without adding a fullName column to the table? i tried using http://www.22bugs.co/post/searching-peoples-names-with-sql-server-full-text-search/ but does not work either