?
Solved

Order by Relevance

Posted on 2004-09-19
6
Medium Priority
?
323 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

770 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