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

  • SEARCH
  • Home
  • 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 6323451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:31:07+00:00 2026-05-24T16:31:07+00:00

I have a search query that takes a phrase typed in by the user

  • 0

I have a search query that takes a phrase typed in by the user and should return a result, here is an example:

SELECT rank,[KEY] FROM CONTAINSTABLE(tblproduct, (title,subtitle,publisher_name),  @search_text,15)

Where @search_text is

Set @search_text = '"my favourite word*"'

The phrase, as it stands, is an exact title match to a book in the database. However, the wildcard (*), makes it so that it doesn’t return ANY results.

When I omit the wildcard, I get an exact phrase match, however, some other phrases, like “The Imperfectionists” returns no results with or without the wildcard in place.

Why is this? What can I check?

Currently, if no result-set is generated for the wildcard, I run the query without the wildcard to see if it returns anything. If that fails too, I run a normal “like” statement.

Obviously the like statement will take forever… and I don’t want to use it on a 7.6 million-strong database for a search that’s supposed to be done with fulltext…

Any help appreciated!

  • 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-24T16:31:08+00:00Added an answer on May 24, 2026 at 4:31 pm

    Using JStead’s suggestion, I looked at the output for your string. I also found this at MSDN:

    When is a phrase, each word contained in the phrase is
    considered to be a separate prefix. Therefore, a query specifying a
    prefix term of “local wine*” matches any rows with the text of “local
    winery”, “locally wined and dined”, and so on.

    So, the word My is considered a “Noise word” by default. Adding the * causes the parser to look for any words starting with My. However, when searching the index, the word My seems to already have been removed (remember, it’s a noise word), so it doesn’t find the match.

    I’m thinking about running my search string through the sys.dm_fts_parser function, removing noise words, before adding the *.

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

Sidebar

Related Questions

I have a query that takes too long to respond when the search parameter
I have a problem with my search query, $s_query. The user can search a
Okay, so I have a website where the user can put a search query
I have this query where I can search the TABLE_GLOBAL_PRODUCTS $catglobal_sql = select p.*,
I have this sql query: SELECT S.SEARCH, S.STATUS, C.TITLE AS CategoryName, E.SEARCH_ENGINES AS Engine,
I have a query factory that takes a column name as an attribute in
I have a search method that takes a list of ID's and I wish
I have a query that takes too long and frequently times out. It's a
I have SQL Server 2005 Report that takes a parameter in a query string
I have a query that originally looks like this: select c.Id, c.Name, c.CountryCode, c.CustomerNumber,

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.