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

Product name search Best practices

 
   Database Forums (Home) -> Full Text RSS
Next:  bringing data from Oracle 10g Rev1 64bit  
Author Message
Med

External


Since: Mar 03, 2007
Posts: 5



(Msg. 1) Posted: Wed Jan 30, 2008 2:43 pm
Post subject: Product name search Best practices
Archived from groups: microsoft>public>sqlserver>fulltext (more info?)

Hi,

I have enabled full-text search on ProductName column of my Products table,
using ProductId (PK) as key.

My asp.net web aoolication, filters the search (remove none alpha-numeric
and unwanted chars) and pass it as parameter to the stored procudure.
Following is a typical SP code that executes:



declare @_ProductName nvarchar(1024)
set @_ProductName = N' "24" NEAR "dell" NEAR "lcd" NEAR "monitor" NEAR
"with" NEAR "hight" NEAR "100mm" NEAR "adjustment" '

select productname
from Products
where contains (ProductName, @_ProductName)

However, it seems that "CONTAINS" method has some limitation on very
specific LONG search keywords. i.e. Above code will not return any rows,
but if i remove some parts of it like ("dell" NEAR "lcd" NEAR "monitor")
will return correct result.

On the other hnd, FREETEXT return too many rows. Does anyone has a better
method of searching a single full-text column, for product search that could
be used in an asp.net web application?


Kind Regards

Med

 >> Stay informed about: Product name search Best practices 
Back to top
Login to vote
Hilary Cotter

External


Since: Oct 09, 2005
Posts: 78



(Msg. 2) Posted: Fri Feb 01, 2008 10:53 am
Post subject: Re: Product name search Best practices [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You would be best to use a containstable function and then order by
rank. The problem with your approach is that all the words must exist
in the row before it is returned. So if one is missing, the row will
not show up in a search.

On Jan 30, 9:43 am, "Med" wrote:
> Hi,
>
> I have enabled full-text search on ProductName column of my Products table,
> using ProductId (PK) as key.
>
> My asp.net web aoolication, filters the search (remove none alpha-numeric
> and unwanted chars) and pass it as parameter to the stored procudure.
> Following is a typical SP code that executes:
>
> declare @_ProductName nvarchar(1024)
> set @_ProductName = N' "24" NEAR "dell" NEAR "lcd" NEAR "monitor" NEAR
> "with" NEAR "hight" NEAR "100mm" NEAR "adjustment" '
>
> select productname
> from Products
> where contains (ProductName, @_ProductName)
>
> However, it seems that "CONTAINS" method has some limitation on very
> specific LONG search keywords.  i.e. Above code will not return any rows,
> but if i remove some parts of it like ("dell" NEAR "lcd" NEAR "monitor")
> will return correct result.
>
> On the other hnd, FREETEXT return too many rows.  Does anyone has a better
> method of searching a single full-text column, for product search that could
> be used in an asp.net web application?
>
> Kind Regards
>
> Med

 >> Stay informed about: Product name search Best practices 
Back to top
Login to vote
Med

External


Since: Mar 03, 2007
Posts: 5



(Msg. 3) Posted: Sun Feb 03, 2008 1:16 am
Post subject: Re: Product name search Best practices [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the suggestion Hilary, I'll give it try.

Med


"Hilary Cotter" wrote in message

You would be best to use a containstable function and then order by
rank. The problem with your approach is that all the words must exist
in the row before it is returned. So if one is missing, the row will
not show up in a search.

On Jan 30, 9:43 am, "Med" wrote:
> Hi,
>
> I have enabled full-text search on ProductName column of my Products
> table,
> using ProductId (PK) as key.
>
> My asp.net web aoolication, filters the search (remove none alpha-numeric
> and unwanted chars) and pass it as parameter to the stored procudure.
> Following is a typical SP code that executes:
>
> declare @_ProductName nvarchar(1024)
> set @_ProductName = N' "24" NEAR "dell" NEAR "lcd" NEAR "monitor" NEAR
> "with" NEAR "hight" NEAR "100mm" NEAR "adjustment" '
>
> select productname
> from Products
> where contains (ProductName, @_ProductName)
>
> However, it seems that "CONTAINS" method has some limitation on very
> specific LONG search keywords. i.e. Above code will not return any rows,
> but if i remove some parts of it like ("dell" NEAR "lcd" NEAR "monitor")
> will return correct result.
>
> On the other hnd, FREETEXT return too many rows. Does anyone has a better
> method of searching a single full-text column, for product search that
> could
> be used in an asp.net web application?
>
> Kind Regards
>
> Med
 >> Stay informed about: Product name search Best practices 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
best practices for rebuilding full text search - Hi We are working with a sql server 2000 using full text search, which works well so far. However, we are not sure which is the best way to ensure the full text search is always working properly. As changes to the database should be immediatly..

Looking for existing tool/product to integrate in MS CMS/S.. - Hi all! I am the IT manager for the Flemish Red Cross and I am looking for an existing tool/product that we can use to implement a full text-search (including webpages, Word documents and PDF's) on our new website, thta we're building on MS CMS and..

Is there any way to search for ".NET" or "C++" - Is there a way to specifically add ".NET" or "C++" so that they WILL be indexed inside of word or rtf docs? Or is there a replacement IFilter that will do it? Kyle!

FullText Search - Okay, I believe I am missing something crucial to fulltext searching. We are looking at ways to change a search from using "like" to "contains" in hopes of improving search performance on a table. We have a fulltext index on a last...

Search Design - Hi I have a requiremnt for a Keyword search on 15 fileds on my tables. There are 4 tables - Each table has 3 fields of varchar. which needs to be idexed for full text. i.e Full text index on 4 tables, each table has index on 3 columns. Will there be....
   Database Forums (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 ]