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!
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(@.se archphra
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,charinde x(@.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,charind ex(@.searchphrase,
charcol)-50,100),@.searchphrase,@.MarkedupSearchPhrase)),char index('
',reverse(replace(substring(charcol,charindex(@.sea rchphrase,
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,charinde x(@.searc
hphrase, charcol)-50,100))) =-1 then
replace(substring(charcol,charindex(@.searchphrase,
charcol)-50,100),@.searchphrase,@.MarkedupSearchPhrase)
else replace(replace(substring(charcol,charindex(@.searc hphrase,
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.
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
"Dave Hickson" <DaveHickson@.discussions.microsoft.com> wrote in message
news:BEEC89DE-421F-4C0C-84A2-94ADA5B3B56C@.microsoft.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
> 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!
|||Thanks very much Hilary. I assume from your answer that there is therefore
no built-in support for such abstracts?
"Hilary Cotter" wrote:
> 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(@.se archphra
> 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,charinde x(@.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,charind ex(@.searchphrase,
> charcol)-50,100),@.searchphrase,@.MarkedupSearchPhrase)),char index('
> ',reverse(replace(substring(charcol,charindex(@.sea rchphrase,
> 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,charinde x(@.searc
> hphrase, charcol)-50,100))) =-1 then
> replace(substring(charcol,charindex(@.searchphrase,
> charcol)-50,100),@.searchphrase,@.MarkedupSearchPhrase)
> else replace(replace(substring(charcol,charindex(@.searc hphrase,
> 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.
>
> --
> 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
> "Dave Hickson" <DaveHickson@.discussions.microsoft.com> wrote in message
> news:BEEC89DE-421F-4C0C-84A2-94ADA5B3B56C@.microsoft.com...
> the
> Full-Text
> Server
>
>
|||Not in this current version, or the next.
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
"Dave Hickson" <DaveHickson@.discussions.microsoft.com> wrote in message
news:71E03E56-85DE-45DC-A148-342756EC7CC9@.microsoft.com...
> Thanks very much Hilary. I assume from your answer that there is
therefore[vbcol=seagreen]
> no built-in support for such abstracts?
> "Hilary Cotter" wrote:
the[vbcol=seagreen]
select --1,firstword=len(@.searchphrase)-(len(substring(charcol,charindex(@.se[vbcol=seagreen]
charcol)-50,100))-charindex('shadow',substring(charcol,charindex(@.se archphra[vbcol=seagreen]
charcol)-50,100))-charindex(@.SearchPhrase,substring(charcol,charinde x(@.searc[vbcol=seagreen]
replace(ltrim(substring(replace(substring(charcol, charindex(@.searchphrase,[vbcol=seagreen]
charcol)-50,100),@.searchphrase,@.MarkedupSearchPhrase),1,len (replace(substrin[vbcol=seagreen]
charcol)-50,100),@.searchphrase,@.MarkedupSearchPhrase))))))) ,char(13)+char(10[vbcol=seagreen]
charcol)-50,100))-charindex(@.SearchPhrase,substring(charcol,charinde x(@.searc[vbcol=seagreen]
charcol)-50,100),@.searchphrase,@.MarkedupSearchPhrase),char( 13)+char(10),' ')[vbcol=seagreen]
or[vbcol=seagreen]
phrase).[vbcol=seagreen]
the[vbcol=seagreen]
Server[vbcol=seagreen]
of[vbcol=seagreen]
such[vbcol=seagreen]
combine[vbcol=seagreen]
will[vbcol=seagreen]
column[vbcol=seagreen]
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment