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

partial search using fulltext

 
   Database Help (Home) -> Full Text RSS
Next:  automatic entry of previous record  
Author Message
Supremestar

External


Since: Nov 04, 2008
Posts: 1



(Msg. 1) Posted: Tue Nov 04, 2008 2:15 pm
Post subject: partial search using fulltext
Archived from groups: microsoft>public>sqlserver>fulltext (more info?)

Hello Friends,

I am using fulltext search in one of the project and the requirement is

I have to search a table basing on a string like 'Hot Choclolate' and store
the result set in to an XML string.

Second I have to do the partial search again with the same string but this
time I have to search with 'Hot' seperately and with 'Chocolate' seperately
and make another XML result set.

I have to combine these two (or may be three or may be more, depending on
the search string ex: 'Hot Spicy Chocolate' or 'Hot Brown Milky Chocolate'
etc.)

But the first 'Hot Chocolate' should take highiest weight and not the
splitted search with either 'Hot or 'Chocolate'

Is this possible to do this one query and make it look like simple or Do I
have to do this in different steps and concatinate all the results. The
problem is I don't have any control over how many words are coming through
the strings. It may come 'Hot Chocolate' or some time 'Hot Brown Milky
Chocolate' next time some 'blah blah.. n times'. I hope you understand what I
mean..

Please help me to solve this.

Thank you all.

 >> Stay informed about: partial search using fulltext 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 608



(Msg. 2) Posted: Thu Nov 06, 2008 2:09 pm
Post subject: Re: partial search using fulltext [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Supremestar,

Perhaps something like this:

SELECT KeyColumn, SearchText
FROM dbo.Products AS FT_TBL
INNER JOIN CONTAINSTABLE(Products, SearchText,
'ISABOUT ("hot chocolate" weight (1.0), hot weight (.1),
chocolate weight (.1))' ) AS KEY_TBL
ON FT_TBL.KeyColumn = KEY_TBL.[Key]
ORDER BY KEY_TBL.RANK DESC;

The phrase "hot chocolate" is weighted as high as possible and each
individual word "hot", "chocolate" has a low weight. This should usually
give you the ordering that you are after, although a row that had "hot" in
it 10 times would bubble up very high.

Doing separate queries and merging the results is possible, but the rankings
of each query are independent of one another.

FWIW,
RLF


"Supremestar" wrote in message

> Hello Friends,
>
> I am using fulltext search in one of the project and the requirement is
>
> I have to search a table basing on a string like 'Hot Choclolate' and
> store
> the result set in to an XML string.
>
> Second I have to do the partial search again with the same string but this
> time I have to search with 'Hot' seperately and with 'Chocolate'
> seperately
> and make another XML result set.
>
> I have to combine these two (or may be three or may be more, depending on
> the search string ex: 'Hot Spicy Chocolate' or 'Hot Brown Milky Chocolate'
> etc.)
>
> But the first 'Hot Chocolate' should take highiest weight and not the
> splitted search with either 'Hot or 'Chocolate'
>
> Is this possible to do this one query and make it look like simple or Do I
> have to do this in different steps and concatinate all the results. The
> problem is I don't have any control over how many words are coming through
> the strings. It may come 'Hot Chocolate' or some time 'Hot Brown Milky
> Chocolate' next time some 'blah blah.. n times'. I hope you understand
> what I
> mean..
>
> Please help me to solve this.
>
> Thank you all.

 >> Stay informed about: partial search using fulltext 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
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..

Smae Fulltext index name in two DBs on same machine - Hiya All, We run a Developmnet-> Staging -> Production build environment here. We use Red Gate SQL Compare (a REALLY great bit of kit btw) to move between the tiers. We are having a bit of a problem now that we have some fulltext indexes defined....

Fulltext Indexing leaves a transaction open, preventing in.. - Hello, Please read this two threads first, as this all started on .newusers (I'm one of them) More relevant: (http://tinyurl.com/454uav http://preview.tinyurl.com/454uav)..

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", ...
   Database Help (Home) -> Full Text All times are: Pacific Time (US & Canada)
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 ]