more from this site

Post Reply
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

more from this site

Post by KMandalia »

How to add the functionality 'More results from this site' next to each result record?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

more from this site

Post by mark »

Depends on what exactly you want that to do. By default the search will return all matching results from a site. Perhaps you want to redo the search for "just" this site? In that case create a new entry point function called, say "thissite", similar to "mlt". In that set $uq to http://www.thesite.com% and call <search> and <bottom> similar to how mlt does. Note that the work you do in that function will be entirely different than what mlt does between <top> and <search>
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

more from this site

Post by KMandalia »

Thanks. I think you did got my point. On the results page, next to each result record, I want to put a hyperlink that says something like 'more from this site' (similar to what yahoo does). People would click that link and will get all the results from that site ONLY.

But the question is,from the result record how do I extract the url in the form www.thesite.com and then format the sql query to get all results from thesite with the query terms somewhere in it ordered by rank.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

more from this site

Post by mark »

The href should be similar to the one for "find similar" except for cmd=thissite. That will get the query and record id passed in. See the <result_similar> function.

In the thissite function you could do
<sql max=1 "select Url from html where id=$id"></sql>
<rex ">>=\alpha+://=[^/]+" $Url>
<sum "%s%%" $ret>
<$uq=$ret>
Post Reply