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 / December 2006

Tip: Looking for answers? Try searching our database.

SQL as a web search engine

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Oren Levy - 13 Dec 2006 01:51 GMT
Hi All

I’m trying to write a SQL statement for a web search engine, it should do
the following:
Break down the search string into individual words (for example: “500 MHz
microprocessor USB”) and do a Full Text Search on a catalogue for each
individual word and sort it by the rank.
I’m assuming it should also take into consideration reserved words and signs.

Any ideas where to start or if you can help with the SQL statement itself it
would be very very very helpful.

Also if someone know already of a product or a better way to build a search
engine for a web site, I would love to hear about it.

Thank you very much everyone.

Oren Levy
Hilary Cotter - 15 Dec 2006 16:14 GMT
Freetext does much of what you are looking for. Other than that here is
something. I have marked positions to insert your search query

set nocount on
declare @table table (word varchar(50))
declare @searchphrase varchar(1000)
declare @word varchar(50)
declare @count int
set @searchphrase =' the rain in spain stays mainly in the plain '
select @searchphrase =ltrim(rtrim(@searchphrase ))
select @count=len(@searchphrase)-len(replace(@searchphrase,' ',''))
while @count>=0
begin
if @count>0
begin
--insert search query here
insert into @table
select left(@searchphrase, charindex(' ',@searchphrase))
end
else
begin
--insert search query here
insert into @table
select @searchphrase
end
select @searchphrase=substring(@searchphrase, charindex('
',@searchphrase)+1,1000)
select @count=@count-1
end

select * from @table

Signature

Hilary Cotter

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

> Hi All
>
[quoted text clipped - 17 lines]
>
> Oren Levy
 
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.