We help IT Professionals succeed at work.
Get Started

SQL Server 2014 Full Text Search Returns more results with narrow search

Last Modified: 2016-09-15
Hi Guys,

I need help with the full text search. I want the full text to bring the data where all of the words are found in the table ideally more words should narrow the search result. however it is opposite. The more words i put in my search string it brings more records. So effectively it looks for the words in the column and if it finds any match it brings the record. Can you please help?

Here is my code
ensures that full text index is up to date before running the following
EXEC [Core].[USP_Core_WaitForFullTextIndexing] N'LocationFullTextCatalog';

SET @GlobalStringFraction = REPLACE(REPLACE(REPLACE(@GlobalStringFraction,
                                                    N' ', N'<>'), N'><', N''),
                                    N'<>', N' ');
SET @GlobalStringFraction = N'"' + REPLACE(@GlobalStringFraction, N' ',
                                           N'" AND "') + N'"';

PRINT @GlobalStringFraction;

SELECT  LocationId ,
        Rank ,
FROM    [Spaces].[CrossContext].[LocationView] AS t
        INNER JOIN FREETEXTTABLE([Spaces].[CrossContext].[LocationView], ConcatenatedAddressString, @GlobalStringFraction)
        AS k ON t.LocationId = k.[key]
                AND Iso3166MinusOneCountryId = 1
ORDER BY t.LocationId;

Open in new window

I have attached the sample data with the question.

Watch Question
Database Analyst
This problem has been solved!
Unlock 3 Answers and 17 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE