How to add the functionality 'More results from this site' next to each result record?
more from this site
more from this site
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>
more from this site
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.
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.
more from this site
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>
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>