The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

using sa

This works fine:

SELECT cms_content.*
   FROM dba.cms_content
   WHERE CONTAINS (  title, intro, body, footer , 'hello' )

According to the docs, this should retrieve scoring info:

SELECT cms_content.*, ct.*
   FROM dba.cms_content
   WHERE CONTAINS (  title, intro, body, footer , 'hello' ) ct
order by ct.score desc

But iSQL reports a "syntax error near ct on line 3"

What am I missing here?

PS: I tried variations on

SELECT cms_content.*, "contains".score
   FROM dba.cms_content
   WHERE CONTAINS (  body , 'hello' ) 

but all I get is syntax errors there as well

asked 22 Jul '10, 09:59

Vincent%20Buck's gravatar image

Vincent Buck
accept rate: 15%

Scoring is supported only if the CONTAINS clause is part of the table expression (specified in the FROM clause). Only if specified as a table expression is the implicit "score" column added to the projection of the underlying table. For example,

FROM MarketingInformation CONTAINS ( Description, 'cotton' ) as CT
WHERE CT.score > <some value>;

By adding a correlation name, you can use multiple CONTAINS table expressions within the same query, and refer to each search score independently by qualifying the "score" column by the given correlation name.

permanent link

answered 22 Jul '10, 10:44

Glenn%20Paulley's gravatar image

Glenn Paulley
accept rate: 43%

edited 22 Jul '10, 10:49

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 22 Jul '10, 09:59

question was seen: 731 times

last updated: 22 Jul '10, 10:49