Custom proximity search not working

This is driving me around the bend

I have a view called FulltextDiary with a Full-text index defined on it. One of the rows contains the following:

Hi fiona,

2 new real estate offers match the following search criteria:

[...]

I perform the following searches

SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [TEXT1], 'NEAR((new, offers), 20)')

Open in new window



SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [TEXT1], 'NEAR((new, match), 20)')

Open in new window



SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [TEXT1], 'NEAR((new, criteria), 20)')

Open in new window



SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [TEXT1], 'NEAR((real, criteria), 20)')

Open in new window


Happy days. Every one of these returns the above row. Then I execute:


SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [TEXT1], 'NEAR((fiona, offers), 20)')

Open in new window


Nothing. Zilch. Nada. Rien. Sweet Fanny Adams.



Why?
LVL 4
WernerVonBraunAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WernerVonBraunAuthor Commented:
It gets worse. Another row contains:

What is that builder on about?

 

From: Giuseppe Carafa
[...]

When I try

SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [TEXT1], 'NEAR((What, about), 20)')

Open in new window


I get nothin'.

And it gets WORSE:

woot

 

From: Giuseppe Carafa
Sent: 12 June 2015 13:07
[etc...]

SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [DocumentText], 'NEAR((woot, carafa), 50)')

Open in new window


Returns nothing.

SELECT *
  FROM CONTAINSTABLE([dbo].[FulltextDiary], [DocumentText], 'NEAR((woot, carafa), 200)')

Open in new window


DOES return the row. Now I know that there are some new lines and things like that in the text, but I cannot see how there would be more than 50 terms between "woot" and "carafa" in the above text.
0
WernerVonBraunAuthor Commented:
Ok. Never mind.... I found the answer:

http://dougbert.com/blog/post/How-near-is-NEAR-in-SQL-Server-2012-Full-Text-Search.aspx

That explains why I had to increase the proximity search value to much larger values - once the text included periods, this would lead to the parser treating it as a "New line" which increased the proximity value by 8 instead of 1 for a simple space. A New Line would lead to it treating the text as a New Paragraph which increases the proximity number by 128.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WernerVonBraunAuthor Commented:
Found solution myself
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.