IIS Index Server - hit hightlighting wint asp.net

This is Interesting: Free IT Magazines  
Home > Archive > IIS Index Server > February 2007 > hit hightlighting wint asp.net





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author hit hightlighting wint asp.net
savvas stampolloglou

2007-02-13, 7:18 pm

I am creating a search engine with asp.net but until now i haven't
found a working solution
for using the hit highlighter.
Has anyone managed to do it until now?
And if possible if you can give any examlpe


Thanks in advance!

Gang_Warily

2007-02-19, 7:19 am

Hi

I think ASP.net may not affect the hit highlighter.
It is accessed by putting parameters in the URL address.

http://msdn2.microsoft.com/en-us/library/ms692928.aspx
is the documentation for webhits.dll, with examples ...

"savvas stampolloglou" wrote:

> I am creating a search engine with asp.net but until now i haven't
> found a working solution
> for using the hit highlighter.
> Has anyone managed to do it until now?
> And if possible if you can give any examlpe
>
>
> Thanks in advance!
>
>

Fred Kogel

2007-02-20, 1:17 pm

=?Utf-8?B?R2FuZ19XYXJpbHk=?= <GangWarily@discussions.microsoft.com>
schrieb in news:53F273B4-4CFB-4300-B30F-FE92F9EF9B88@microsoft.com:
[vbcol=seagreen]
> Hi
>
> I think ASP.net may not affect the hit highlighter.
> It is accessed by putting parameters in the URL address.
>
> http://msdn2.microsoft.com/en-us/library/ms692928.aspx
> is the documentation for webhits.dll, with examples ...
>
> "savvas stampolloglou" wrote:
>

don't use the highlighter, built your own one ...

1) Define a new CSS-Class which makes the text highlighted (i.e. yellow
background)
2) Write a function to change your search-results ...
3) in your results HTML-Code let the function enlose your search-phrase
with your new CSS-tag

works fine, is fast & short
regards
Fred (from Germany)



THE FUNCTION:
Function Highlight(Search_Str as String, InputTxt as String, StartTag as
String, EndTag as String) As String

Return Regex.Replace(InputTxt, "(" & Regex.Escape(Search_Str) & ")",
StartTag & "$1" & EndTag, RegExOptions.IgnoreCase)

End Function

THE FUNCTION CALL:
MyHigLightedHTMLCode = Highlight(MySearchString, MyHTMLCode, "<span
class=highlight>", "</span>")
Hilary Cotter

2007-02-20, 1:17 pm

One slight problem - this doesn't work with freetext.

--
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



"Fred Kogel" <fred.kogel@yahoo.com> wrote in message
news:Xns98DDA5D326D34fredkogelyahoocom@1
51.189.20.10...
> =?Utf-8?B?R2FuZ19XYXJpbHk=?= <GangWarily@discussions.microsoft.com>
> schrieb in news:53F273B4-4CFB-4300-B30F-FE92F9EF9B88@microsoft.com:
>
>
> don't use the highlighter, built your own one ...
>
> 1) Define a new CSS-Class which makes the text highlighted (i.e. yellow
> background)
> 2) Write a function to change your search-results ...
> 3) in your results HTML-Code let the function enlose your search-phrase
> with your new CSS-tag
>
> works fine, is fast & short
> regards
> Fred (from Germany)
>
>
>
> THE FUNCTION:
> Function Highlight(Search_Str as String, InputTxt as String, StartTag as
> String, EndTag as String) As String
>
> Return Regex.Replace(InputTxt, "(" & Regex.Escape(Search_Str) & ")",
> StartTag & "$1" & EndTag, RegExOptions.IgnoreCase)
>
> End Function
>
> THE FUNCTION CALL:
> MyHigLightedHTMLCode = Highlight(MySearchString, MyHTMLCode, "<span
> class=highlight>", "</span>")



Fred Kogel

2007-02-21, 7:25 am

"Hilary Cotter" <hilary.cotter@gmail.com> schrieb in news:OTAEJzQVHHA.1636
@TK2MSFTNGP02.phx.gbl:

> One slight problem - this doesn't work with freetext.
>



why not (or maybe I did not understand)? The point is, that you highlight
the search phrase in the query's result(!).

If you use ASP.NET you should have and therefore control the result string
no matter what query-technique you use. Search & replace the search-phrase
and that's it.

We use it in different projects.

regards
Fred


Hilary Cotter

2007-02-21, 7:16 pm

search on mouse with a freetext query and your content has mouse and mice in
it. How are you going to mark up mice?

--
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

"Fred Kogel" <fred.kogel@yahoo.com> wrote in message
news:Xns98DE711EE3BF2fredkogelyahoocom@1
51.189.20.10...
> "Hilary Cotter" <hilary.cotter@gmail.com> schrieb in news:OTAEJzQVHHA.1636
> @TK2MSFTNGP02.phx.gbl:
>
>
>
> why not (or maybe I did not understand)? The point is, that you highlight
> the search phrase in the query's result(!).
>
> If you use ASP.NET you should have and therefore control the result string
> no matter what query-technique you use. Search & replace the search-phrase
> and that's it.
>
> We use it in different projects.
>
> regards
> Fred
>
>



Fred Kogel

2007-02-22, 7:15 pm

"Hilary Cotter" <hilary.cotter@gmail.com> schrieb in
news:eBMqtbhVHHA.868@TK2MSFTNGP05.phx.gbl:

> search on mouse with a freetext query and your content has mouse and
> mice in it. How are you going to mark up mice?


thank you, I understand (and didn't understand before as I already feared).
Now it's evident that our 'technique' does only work with simpler animals
than mice ;-)

regards
fred
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com