PDA

View Full Version : limit results?


mikeduff
11-13-2003, 06:11 AM
Hello, I was wondering if anyone had created code to limit results. What I mean by this is, instead of returning 4324 results from the same site, after 5 or so, it would move on to the next site. becouse when I search on the one I made, the first 5-6 pages are all this one site, and if i wanted to view that many from the same site, I would clikc on the limit to link. make sense? can anyone help me.

Charter
11-17-2003, 12:00 AM
Hi. PhpDig version 1.6.4 has an option in the config file to set the max number of results per site to display. When set to X, there will be at most X results from each of Y sites displayed, and if limit to a certain site is clicked, X results for that site will be displayed.

sid
11-17-2003, 12:39 AM
I'm new to this, but can you please tell me how this 'limit' thing work and also, I didn't get one feature:
the is a $site var in PhpDig, for example search.php?query_string=blablabla&site=

Can you please explain to me these 2 features?

Charter
11-17-2003, 01:35 AM
Hi. If you click the limit to website link, then only results from that website are displayed. The site variable identifies a website.

sid
11-17-2003, 06:05 PM
I did that limit thing, but, you said it will show all the results from that site, it is only showing the 'result per site' I limited which is 2 results per site. Is there anyway to show only 2 results in the whole results page and all the results from that site in the limit?

Thanks.

Charter
11-25-2003, 02:50 PM
Originally posted by Charter
... When set to X, there will be at most X results from each of Y sites displayed, and if limit to a certain site is clicked, X results for that site will be displayed.
Hi. Actually it works like above. ;)

However, if you want to have at most X results from each of Y sites displayed on a 'main' search, and then want all results for a given site displayed on a 'limit to' search, just do the following.

In search_function.php find:

if(NUMBER_OF_RESULTS_PER_SITE != -1) {

and replace with:

if((!$refine) && (NUMBER_OF_RESULTS_PER_SITE != -1)) {