[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Order by Relevance

Posted on 2004-09-19
6
Medium Priority
?
325 Views
Last Modified: 2008-02-01
First off, sorry. 45 points is all the points I have left. :(

One of my tables has 3 text columns. I'm searching these three columns for words. I want to order the results by the total number of words found in all three columns combined.

Is it possible? I don't want to use VBScript to reorder them, especially if I have 1000 results.

Thanks,
Richard
0
Comment
Question by:nightzeus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 1

Author Comment

by:nightzeus
ID: 12097647
0
 
LVL 1

Author Comment

by:nightzeus
ID: 12097696
Nevermind.. It seems to be part of another Microsoft program.

SharePoint
0
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 180 total points
ID: 12097854
No, no, ContainsTable is your best solution, and it's part of SQL Server. I wasn't going to post anything, since it looked like you were on the right track, and you could delete the question and save your points if you finished on your own.

Run "sp_fulltext_database enable" to turn on full-text indexing on the database.

If you get an error message it's probably because full-text indexing wasn't installed. Put in your CD and start the install process, and choose "Upgrade, remove, or add components to an existing instance of SQL Server." when it gives you that choice. Then in the Select Components window, select Server Component on the left, then check "Full-Text Search" on the right.

Once it's installed and the database is enabled, you have to enable the table:
sp_fulltext_table [ @tabname = ] 'qualified_table_name'
    , [ @action = ] 'action'
    [ , [ @ftcat = ] 'fulltext_catalog_name'
    , [ @keyname = ] 'unique_index_name' ]

Once you have the table enabled, you have to enable each of the three columns you want to use for your relevance ranking.

Then you can write a SELECT query with a ContainsTable clause.

See SQL Server Books Online (BOL) for sample code and more info.
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 1

Author Comment

by:nightzeus
ID: 12097875
Thank you. :)
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 12097917
You're welcome. I forgot to post the procedure for enabling columns:

sp_fulltext_column [ @tabname = ] 'qualified_table_name' ,
    [ @colname = ] 'column_name' ,
    [ @action = ] 'action'
    [ , [ @language = ] 'language' ]
    [ , [ @type_colname = ] 'type_column_name' ]
0
 
LVL 1

Author Comment

by:nightzeus
ID: 12097922
:))) Thanks again.

Richard
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ready to get certified? Check out some courses that help you prepare for third-party exams.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question