Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 658399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:55:46+00:00 2026-05-13T22:55:46+00:00

I’m have some trouble with the fulltext CONTAINS operator. Here’s a quick script to

  • 0

I’m have some trouble with the fulltext CONTAINS operator. Here’s a quick script to show what I’m doing. Note that the WAITFOR line simply gives the fulltext index a moment to finish filling up.

create table test1 ( id int constraint pk primary key, string nvarchar(100) not null );
insert into test1 values (1, 'dog')
insert into test1 values (2, 'dogbreed')
insert into test1 values (3, 'dogbreedinfo')
insert into test1 values (4, 'dogs')
insert into test1 values (5, 'breeds')
insert into test1 values (6, 'breed')
insert into test1 values (7, 'breeddogs')

go
create fulltext catalog cat1
create fulltext index on test1 (string) key index pk on cat1
waitfor delay '00:00:03' 
go
select * from test1 where contains (string, '"*dog*"')

go
drop table test1
drop fulltext catalog cat1

The result set returned is:

1   dog
2   dogbreed
3   dogbreedinfo
4   dogs

Why is record #7 ‘breeddogs’ not returned?

EDIT

Is there another way I should be searching for strings that are contained in other strings? A way that is faster than LIKE ‘%searchword%’ ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:55:46+00:00Added an answer on May 13, 2026 at 10:55 pm

    Just because MS Full-Text search does not support suffix search – only prefix, i.e. ‘* ‘ in front of ‘*dog *’ is simply ignored. It is clearly stated in Books Online btw.

    CONTAINS can search for:

    • A word or phrase.
    • The prefix of a word or phrase.
    • A word near another word.
    • A word inflectionally generated from another (for example, the word drive is the inflectional stem of drives, drove, driving, and driven).
    • A word that is a synonym of another word using a thesaurus (for example, the word metal can have synonyms such as aluminum and steel).

    Where prefix term is defined like this:

    < prefix term > ::= { "word *" | "phrase *" }

    So, unfortunately: there’s no way to issue a LIKE search in fulltext search.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.