sql server - Microsoft SQL single character full text search works with 25 out of 26 letters - but not "n" - returns all rows -


found interesting issue quick search if single character search, 25 characters work fine, 1 doesn’t – “n” quick search select of form:

select* some_full_text_table contains(the_full_text_field, ' "n*" ') 

this should search full text field in table beginning “n”.

example data rows:

  1. “name1 foo bar cardiac”
  2. “aname foo2 echo”
  3. “some name foo3 ct”
  4. “the requested letter”

the query should return rows 1 , 3 1 have words begin “n”.

the actual result rows returned, row 4, has no n’s @ all.

i believe sql bug. “na*” works expected , returns 1 , 3.

looking solution or work around

here example sql 2014

create table testfulltextsearch (     id int not null,     alltext nvarchar(400) )  create unique index test_tfts on testfulltextsearch(id); create fulltext catalog ftcat_tfts; create fulltext index on testfulltextsearch(alltext)     key index test_tfts on ftcat_tfts     change_tracking auto, stoplist off go  /* no n's in data */  insert testfulltextsearch values (1, 'legacyreport report legacy 23049823490  20150713 cardiac ') insert testfulltextsearch values (2, '123-45-678 foo bar  19450712 20020723 exercise stress ') insert testfulltextsearch values (3, '2048 jj goodguy xy2000 19490328 20150721 cardiac ') insert testfulltextsearch values (4, '12345678 4.0 allcalcs  19650409 20031103 cardiac difficult ')  select * testfulltextsearch contains(alltext, '"n*"')  /* result of select */ 1   legacyreport report legacy 23049823490  20150713 cardiac  2   123-45-678 foo bar  19450712 20020723 exercise stress  3   2048 jj goodguy xy2000 19490328 20150721 cardiac  4   12345678 4.0 allcalcs  19650409 20031103 cardiac difficult  


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -