For the first time, I'm using full-text search. I have SQL Server 2022 Standard installed, and I've set up full-text search. I created a full-text catalog, [fullTextCatalog_CjeniciArtikli]
, with ACCENT_SENSITIVITY = OFF
.
I have a table named CjeniciArtikli
with a column, Naziv
, which I've created a full-text index for. The language is set to Croatian, and accent_sensitive
is set to false.
When I execute the query below, it doesn't return any results, although it should:
SELECT *
FROM CjeniciArtikli
WHERE CONTAINS(Naziv, 'orink AND tinta AND za AND canon');
However, when I use the LIKE
operator with a similar query, it returns 64 records, which is correct:
SELECT *
FROM CjeniciArtikli
WHERE Naziv LIKE '%orink%' AND Naziv LIKE '%tinta%' AND Naziv LIKE '%za%' AND Naziv LIKE '%canon%';
If I modify the first query by removing the word 'za', it returns the records as expected (just like when using LIKE), even though some of those records contain the word 'za'. For example, the first result returned is
Orink tinta za Canon, CLI-521GY, siva, OR-CCLI521G with chi
which contains word 'za'.
SELECT *
FROM CjeniciArtikli
WHERE CONTAINS(Naziv, 'orink AND tinta AND canon'); --works
When I tried searching for just the word 'za', it didn't return any results:
SELECT *
FROM CjeniciArtikli
WHERE CONTAINS(Naziv, 'za');
However, when I used LIKE, it returned 5,877 records:
SELECT *
FROM CjeniciArtikli
WHERE Naziv LIKE '% za %';
I initially thought the issue might be due to two-letter words, but when I tested a query with the word 'sa', it worked without any problems.
I haven't been able to find a solution on the internet or through AI language models, including ChatGPT.
If anyone knows what might be causing this issue, I would greatly appreciate any assistance. I've tried several resources, but without success.