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 / August 2005

Tip: Looking for answers? Try searching our database.

Abstracts for Full-Text Index entries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave Hickson - 17 Aug 2005 11:23 GMT
When using Microsoft Index Server file system catalogs, the Index Server
generates 'abstracts' which give the user an 'at a glance' indication of the
entry contents.  Does Full-Text Indexing within SQL Server provide such
abstracts?

I am developing a search facility for a web site where I want to combine
search results for static web pages (managed by Index Server) with Full-Text
search results from SQL.  I'll union the two results sets.  I can get
abstracts for the Index Server entries, but can't find anything that will
give me a similar abstracts for the SQL entries.  I could just use column
contents, but I'd rather have something more in keeping with the Index Server
abstracts.

Anyone got any good ideas?

Many thanks!
Hilary Cotter - 17 Aug 2005 12:59 GMT
Indexing services abstracts are the first 320 bytes of textual data in
Office documents or the contents of the description metatag for html
documents. If the html document does not have a description metatag, its the
first 320 bytes of the html document.

For sql you have to do something like this

declare @searchphrase varchar(20)

declare @MarkedupSearchPhrase varchar(20)

set @searchphrase='shadow'

set @MarkedupSearchPhrase ='<B>shadow</B>'

select --1,firstword=len(@searchphrase)-(len(substring(charcol,charindex(@se
archphrase,
charcol)-50,100))-charindex('shadow',substring(charcol,charindex(@searchphra
se, charcol)-50,100))),

--len(substring(charcol,charindex(@searchphrase, charcol)-50,100)),

MarkedUpColumn = case when len(charcol) >100 and
len(@searchphrase)-(len(substring(charcol,charindex(@searchphrase,
charcol)-50,100))-charindex(@SearchPhrase,substring(charcol,charindex(@searc
hphrase, charcol)-50,100))) <>-1 then
replace(ltrim(substring(replace(substring(charcol,charindex(@searchphrase,
charcol)-50,100),@searchphrase,@MarkedupSearchPhrase),1,len(replace(substrin
g(charcol,charindex(@searchphrase,
charcol)-50,100),@searchphrase,@MarkedupSearchPhrase))-
len(left(reverse(replace(substring(charcol,charindex(@searchphrase,
charcol)-50,100),@searchphrase,@MarkedupSearchPhrase)),charindex('
',reverse(replace(substring(charcol,charindex(@searchphrase,
charcol)-50,100),@searchphrase,@MarkedupSearchPhrase))))))),char(13)+char(10
),' ')

when len(charcol) >100 and
len(@searchphrase)-(len(substring(charcol,charindex(@searchphrase,
charcol)-50,100))-charindex(@SearchPhrase,substring(charcol,charindex(@searc
hphrase, charcol)-50,100))) =-1 then
replace(substring(charcol,charindex(@searchphrase,
charcol)-50,100),@searchphrase,@MarkedupSearchPhrase)

else replace(replace(substring(charcol,charindex(@searchphrase,
charcol)-50,100),@searchphrase,@MarkedupSearchPhrase),char(13)+char(10),' ')
end

from texttable where FreeText(*,@searchphrase)

this needs some more work as I have to correctly remove the first word or
word fragment in the markedupColumn (as long as its not the search phrase).
This also does inline hit highlighting.

For "true" abstracts like what indexing services delivers you should use the
left function.

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

> When using Microsoft Index Server file system catalogs, the Index Server
> generates 'abstracts' which give the user an 'at a glance' indication of the
[quoted text clipped - 12 lines]
>
> Many thanks!
Dave Hickson - 18 Aug 2005 10:51 GMT
Thanks very much Hilary.  I assume from your answer that there is therefore
no built-in support for such abstracts?

> Indexing services abstracts are the first 320 bytes of textual data in
> Office documents or the contents of the description metatag for html
[quoted text clipped - 71 lines]
> >
> > Many thanks!
Hilary Cotter - 18 Aug 2005 11:23 GMT
Not in this current version, or the next.

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

> Thanks very much Hilary.  I assume from your answer that there is therefore
> no built-in support for such abstracts?
[quoted text clipped - 13 lines]
> >
> > set @MarkedupSearchPhrase ='<B>shadow</B>'

select --1,firstword=len(@searchphrase)-(len(substring(charcol,charindex(@se
> > archphrase,

charcol)-50,100))-charindex('shadow',substring(charcol,charindex(@searchphra
> > se, charcol)-50,100))),
> >
> > --len(substring(charcol,charindex(@searchphrase, charcol)-50,100)),
> >
> > MarkedUpColumn = case when len(charcol) >100 and
> > len(@searchphrase)-(len(substring(charcol,charindex(@searchphrase,

charcol)-50,100))-charindex(@SearchPhrase,substring(charcol,charindex(@searc
> > hphrase, charcol)-50,100))) <>-1 then

replace(ltrim(substring(replace(substring(charcol,charindex(@searchphrase,

charcol)-50,100),@searchphrase,@MarkedupSearchPhrase),1,len(replace(substrin
> > g(charcol,charindex(@searchphrase,
> > charcol)-50,100),@searchphrase,@MarkedupSearchPhrase))-
> > len(left(reverse(replace(substring(charcol,charindex(@searchphrase,
> > charcol)-50,100),@searchphrase,@MarkedupSearchPhrase)),charindex('
> > ',reverse(replace(substring(charcol,charindex(@searchphrase,

charcol)-50,100),@searchphrase,@MarkedupSearchPhrase))))))),char(13)+char(10
> > ),' ')
> >
> > when len(charcol) >100 and
> > len(@searchphrase)-(len(substring(charcol,charindex(@searchphrase,

charcol)-50,100))-charindex(@SearchPhrase,substring(charcol,charindex(@searc
> > hphrase, charcol)-50,100))) =-1 then
> > replace(substring(charcol,charindex(@searchphrase,
> > charcol)-50,100),@searchphrase,@MarkedupSearchPhrase)
> >
> > else replace(replace(substring(charcol,charindex(@searchphrase,

charcol)-50,100),@searchphrase,@MarkedupSearchPhrase),char(13)+char(10),' ')
> > end
> >
[quoted text clipped - 26 lines]
> > >
> > > Many thanks!
 
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.