Reputation: 33
I have a table with just 2 columns Id (identity) and lastname(nvarchar). I applied a fulltextIndex WITH ACCENT_SENSITIVITY = OFF for dutch --> 1043 on lastname with an empty stop words list and added 2 records:
insert into [UserProfile] values ('hoopman') insert into [UserProfile] values ('koopmans')
when i do:
SELECT * from CONTAINSTABLE(UserProfile, Lastname, '"man*"', LANGUAGE 1043)
I only get koopmans.
but if I do
SELECT * from CONTAINSTABLE(UserProfile, Lastname, '"hoopman*"', LANGUAGE 1043)
I do get hoopman.
Here is the script to reproduce the scenario
USE [master]
GO
/****** Object: Database [Tests] Script Date: 11/01/2023 13:43:25 ******/
CREATE DATABASE [Tests]
WITH CATALOG_COLLATION = DATABASE_DEFAULT
GO
ALTER DATABASE [Tests]SET COMPATIBILITY_LEVEL = 150
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [Tests].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [Tests]SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [Tests]SET ANSI_NULLS OFF
GO
ALTER DATABASE [Tests]SET ANSI_PADDING OFF
GO
ALTER DATABASE [Tests]SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [Tests]SET ARITHABORT OFF
GO
ALTER DATABASE [Tests]SET AUTO_CLOSE OFF
GO
ALTER DATABASE [Tests]SET AUTO_SHRINK OFF
GO
ALTER DATABASE [Tests]SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [Tests]SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [Tests]SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [Tests]SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [Tests]SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [Tests]SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [Tests]SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [Tests]SET DISABLE_BROKER
GO
ALTER DATABASE [Tests]SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [Tests]SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [Tests]SET TRUSTWORTHY OFF
GO
ALTER DATABASE [Tests]SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [Tests]SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [Tests]SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [Tests]SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [Tests]SET RECOVERY FULL
GO
ALTER DATABASE [Tests]SET MULTI_USER
GO
ALTER DATABASE [Tests]SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [Tests]SET DB_CHAINING OFF
GO
ALTER DATABASE [Tests]SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE [Tests]SET TARGET_RECOVERY_TIME = 60 SECONDS
GO
ALTER DATABASE [Tests]SET DELAYED_DURABILITY = DISABLED
GO
ALTER DATABASE [Tests]SET ACCELERATED_DATABASE_RECOVERY = OFF
GO
EXEC sys.sp_db_vardecimal_storage_format N'Tests', N'ON'
GO
ALTER DATABASE [Tests] SET QUERY_STORE = OFF
GO
USE [Tests]
GO
/****** Object: FullTextCatalog Script Date: 11/01/2023 13:43:25 ******/
CREATE FULLTEXT CATALOG [MyCatalog] WITH ACCENT_SENSITIVITY = OFF
AS DEFAULT
GO
/****** Object: Table [dbo].[UserProfile] Script Date: 11/01/2023 13:43:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserProfile](
[Id] [int] IDENTITY(1000000,1) NOT NULL,
[Lastname] [nvarchar](255) NULL,
CONSTRAINT [PK_UserProfile] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER DATABASE [Tests]SET READ_WRITE
GO
CREATE FULLTEXT INDEX ON dbo.UserProfile (
lastname LANGUAGE 1043
) KEY INDEX [PK_UserProfile]
WITH
CHANGE_TRACKING = AUTO,
STOPLIST=OFF
;
GO
then
insert into [UserProfile] values ('hoopman')
insert into [UserProfile] values ('koopmans')
SELECT *
from CONTAINSTABLE(UserProfile, Lastname, '"man*"', LANGUAGE 1043)
thx a lot!
expecting hoopman and koopmans and gettign only koopmans when doing
SELECT *
from CONTAINSTABLE(UserProfile, Lastname, '"man*"', LANGUAGE 1043)
Upvotes: 1
Views: 68