Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / February 2008

Tip: Looking for answers? Try searching our database.

Product name search Best practices

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Med - 30 Jan 2008 14:43 GMT
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
Hilary Cotter - 01 Feb 2008 18:53 GMT
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.

> Hi,
>
[quoted text clipped - 25 lines]
>
> Med
Med - 03 Feb 2008 01:16 GMT
Thanks for the suggestion Hilary, I'll give it try.

Med

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" <nos...@nowhere.nowhere> wrote:
> Hi,
>
[quoted text clipped - 27 lines]
>
> Med
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.