Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

count the amount of keywords found in contain search?

 
   Database Help (Home) -> Full Text RSS
Next:  Not a Benchmark... but sort of...  
Author Message
DAXU

External


Since: Oct 11, 2008
Posts: 1



(Msg. 1) Posted: Sat Oct 11, 2008 1:33 pm
Post subject: count the amount of keywords found in contain search?
Archived from groups: microsoft>public>sqlserver>fulltext (more info?)

Hello,

I am fairly new with full text search. I managed to put the contains
search right. But is it possible to return the amount of keywords
found?
For example, if the keyword searching is "law", both rows:
1. law and order
2. family law and Chinese law
are found.
But how can I return the amount of keyword found (except for having a
function to search for the keyword manually)?

Many Thanks

Jerry

 >> Stay informed about: count the amount of keywords found in contain search? 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 546



(Msg. 2) Posted: Tue Oct 14, 2008 10:57 am
Post subject: Re: count the amount of keywords found in contain search? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jerry,

I don't know of a way to get the number of word hits in a document or a
database row (except looking for it yourself, as you mentioned) in SQL
Server 2005 or earlier.

However, if all you are wanting is to to order the results with the most
hits at the top, you could look into the CONTAINSTABLE or FREETEXTTABLE
functions, which can be specified to return the top n rows from a full text
query. Read more about these in the Books Online.

If you want to know how many hits per word in a document, SQL Server 2008
has a new dynamic management view, sys.dm_fts_index_keywords_by_document,
that will show you the information:
http://msdn.microsoft.com/en-us/library/cc280607.aspx

However, Simon Sabin points out that this is a very expensive view to look
at dynamically. He has recommendations on what you should do if this is
valuable information to you for query purposes.
http://sqlblogcasts.com/blogs/simons/archive/2008/02/20/SQL-Server-200...-iFTS-T

RLF


"DAXU" <DAXU RemoveThis @hotmail.com> wrote in message
news:00769451-4bdd-4656-9f62-b38d47f95b57@l64g2000hse.googlegroups.com...
> Hello,
>
> I am fairly new with full text search. I managed to put the contains
> search right. But is it possible to return the amount of keywords
> found?
> For example, if the keyword searching is "law", both rows:
> 1. law and order
> 2. family law and Chinese law
> are found.
> But how can I return the amount of keyword found (except for having a
> function to search for the keyword manually)?
>
> Many Thanks
>
> Jerry

 >> Stay informed about: count the amount of keywords found in contain search? 
Back to top
Login to vote
Michael Coles

External


Since: Oct 15, 2008
Posts: 3



(Msg. 3) Posted: Wed Oct 15, 2008 2:49 pm
Post subject: Re: count the amount of keywords found in contain search? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

As Russell points out CONTAINSTABLE and FREETEXTTABLE return a rank score
for each match, and the rank factors in the # of times the keyword (or
keywords) occurred in the matching documents. It also factors in several
other items, which you may or may not be interested in. There's a good
article on MSDN (I can't find the link right now) that discusses ranking,
you might want to search that to get specifics.

"DAXU" <DAXU.DeleteThis@hotmail.com> wrote in message
news:00769451-4bdd-4656-9f62-b38d47f95b57@l64g2000hse.googlegroups.com...
> Hello,
>
> I am fairly new with full text search. I managed to put the contains
> search right. But is it possible to return the amount of keywords
> found?
> For example, if the keyword searching is "law", both rows:
> 1. law and order
> 2. family law and Chinese law
> are found.
> But how can I return the amount of keyword found (except for having a
> function to search for the keyword manually)?
>
> Many Thanks
>
> Jerry
 >> Stay informed about: count the amount of keywords found in contain search? 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 546



(Msg. 4) Posted: Wed Oct 15, 2008 4:54 pm
Post subject: Re: count the amount of keywords found in contain search? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I also could not find the article when I looked yesterday, so I looked
again. Here it is:

Understanding Ranking
http://technet.microsoft.com/en-us/library/ms142524(SQL.90).aspx

RLF

"Michael Coles" <michaelcoAToptonlineDOTnet> wrote in message
news:uIpjIavLJHA.4324@TK2MSFTNGP05.phx.gbl...
> As Russell points out CONTAINSTABLE and FREETEXTTABLE return a rank score
> for each match, and the rank factors in the # of times the keyword (or
> keywords) occurred in the matching documents. It also factors in several
> other items, which you may or may not be interested in. There's a good
> article on MSDN (I can't find the link right now) that discusses ranking,
> you might want to search that to get specifics.
>
> "DAXU" <DAXU.RemoveThis@hotmail.com> wrote in message
> news:00769451-4bdd-4656-9f62-b38d47f95b57@l64g2000hse.googlegroups.com...
>> Hello,
>>
>> I am fairly new with full text search. I managed to put the contains
>> search right. But is it possible to return the amount of keywords
>> found?
>> For example, if the keyword searching is "law", both rows:
>> 1. law and order
>> 2. family law and Chinese law
>> are found.
>> But how can I return the amount of keyword found (except for having a
>> function to search for the keyword manually)?
>>
>> Many Thanks
>>
>> Jerry
>
>
 >> Stay informed about: count the amount of keywords found in contain search? 
Back to top
Login to vote
Michael Coles

External


Since: May 29, 2008
Posts: 55



(Msg. 5) Posted: Fri Oct 17, 2008 6:49 pm
Post subject: Re: count the amount of keywords found in contain search? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the update Russell, I was just searching for it to write an
update post for the OP when I saw you already handled it.

--

========
Michael Coles
"Pro T-SQL 2008 Programmer's Guide"
http://www.amazon.com/T-SQL-2008-Programmer-rsquo-Guide/dp/143021001X


"Russell Fields" <russellfields.TakeThisOut@nomail.com> wrote in message
news:uOjh6gwLJHA.1156@TK2MSFTNGP05.phx.gbl...
>I also could not find the article when I looked yesterday, so I looked
>again. Here it is:
>
> Understanding Ranking
> http://technet.microsoft.com/en-us/library/ms142524(SQL.90).aspx
>
> RLF
>
> "Michael Coles" <michaelcoAToptonlineDOTnet> wrote in message
> news:uIpjIavLJHA.4324@TK2MSFTNGP05.phx.gbl...
>> As Russell points out CONTAINSTABLE and FREETEXTTABLE return a rank score
>> for each match, and the rank factors in the # of times the keyword (or
>> keywords) occurred in the matching documents. It also factors in several
>> other items, which you may or may not be interested in. There's a good
>> article on MSDN (I can't find the link right now) that discusses ranking,
>> you might want to search that to get specifics.
>>
>> "DAXU" <DAXU.TakeThisOut@hotmail.com> wrote in message
>> news:00769451-4bdd-4656-9f62-b38d47f95b57@l64g2000hse.googlegroups.com...
>>> Hello,
>>>
>>> I am fairly new with full text search. I managed to put the contains
>>> search right. But is it possible to return the amount of keywords
>>> found?
>>> For example, if the keyword searching is "law", both rows:
>>> 1. law and order
>>> 2. family law and Chinese law
>>> are found.
>>> But how can I return the amount of keyword found (except for having a
>>> function to search for the keyword manually)?
>>>
>>> Many Thanks
>>>
>>> Jerry
>>
>>
>
>
 >> Stay informed about: count the amount of keywords found in contain search? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Retrieving words found in text - Hi, Is there a way to get a list (programmatically) of the words that SQL Server expands a user’s search word to for inflectional search? Example: 1. User searches “run” 2. Inflectional search finds a document with the word “ran” (different...

unknown unique key count variance - I am pretty new to FTS but found I am stuck with a problem that doesn't seem common. In all my searching, I have only come across one post that had the same issue and that was from 2002. ..

Boolean search - Hi all! This is my problem, I hope you can help me... I have an asp web site. I want to search, for exemple in a table of addresses, the string "apple+table", to have all the record in my table where in a list of fields (like name, address, t...

'"n*"' prefix search - Can you tell me why a prefix search like: SELECT <column_list> FROM <table> WHERE CONTAINS(<column1>, '"n*"') (<column1> is a "nvarchar") returns not only records containing text beginning with "n", ...

fulltext search not working - HI!, Fulltext search is not working, i have two databases, fulltext search functionality was working fine on both of them till now. but suddenly fulltext search on one of the databases started giving out errors. when i try to populate, rebuild was..
   Database Help (Home) -> Full Text All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]