Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Limit displayed results...

Quote Reply
Limit displayed results...
I think a good idea (maybe a plugin? maybe not...) would be to limit the results displayed to around 1000, yet provide a complete search count. That is what Google does. The reason you get very fast searches that yield very large results (sometimes millions), is because they only display around 1000 of those links.

For example, when searching for "test" on Google you receive:

Results 1 - 10 of about 46,700,000. Search took 0.15 seconds.

However, the maximum links displayed are 994 (first 100 pages):
http://www.google.com/...mp;sa=N&filter=0

I'm trying to figure out how to do this on my site. I currently have my search results limited to 2000 by simply adding "LIMIT 2000" to the end on the SQL search statements. However, to give a full result count is a whole other story. Maybe one of the perl gurus out there would have some ideas on this.

Sean
Quote Reply
Re: [SeanP] Limit displayed results... In reply to
One suggestion, Sean, is to have two different queries set up, one that gets the "count" of total links that are found with the query, and than another query to show the "limited results".

For the count query, you could simply use the COUNT SQL function to get the count of results.

Example:

SELECT COUNT(*)
FROM Links
WHERE (Something LIKE '%$query%')

Crude example...but I think you catch my drift. And a global tag like <%Search_Count%> may suffice rather than creating a hook or formal plugin for this type of request.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Limit displayed results... In reply to
That's a good idea. I'll have to look at the code again to implement it into the search.

Sean
Quote Reply
Re: [SeanP] Limit displayed results... In reply to
One thing to bear in mind is that if you are not using mod_perl, then executing "double" queries to show the results (count and actual results) in your search result pages, will be more intensive. But I think if you carefully write a global, then it may not be that big of a problem.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Limit displayed results... In reply to
I agree. I am running under mod_perl so I don't think it will be too slow. Running the select count(*) statement in SQL Monitor produces a count very quick (even on intensive searches like '%a%'). I wonder what method Google uses to estimate a results count (Results 1 - 10 of about 47,700,000). That's kind of odd to say "about 47,700,000". Crazy

Sean
Quote Reply
Re: [SeanP] Limit displayed results... In reply to
Don't know for sure, but they use C++ in their search engine technology.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [SeanP] Limit displayed results... In reply to
Maybe they just like rounding their numbers, hence use the word 'about'.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Limit displayed results... In reply to
Uhhh, that was "about" a nice conclusion, Ian! Laugh

Last edited by:

SeanP: Jul 21, 2002, 2:09 PM
Quote Reply
Re: [SeanP] Limit displayed results... In reply to
Did anyone ever come up with a solution for this? I would like to limit the amount of results displayed for security reasons (so someone can't just use something like query=&Title=* and get everytjing)

Any other solutions?

Thanks in advance
Klaus

http://www.ameinfo.com
Quote Reply
Re: [SeanP] Limit displayed results... In reply to
I want to limit my search results. Can anybody tell me where exactly I have to add the SQL Limit ?

Thanks
Quote Reply
Re: [P-Man] Limit displayed results... In reply to
Go to Admin/Setup/Search options
and set the search_maxhits option.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Limit displayed results... In reply to
In Reply To:
Go to Admin/Setup/Search options
and set the search_maxhits option.

Best regards,
Webmaster33[/quote]

No, thatīs not the right point, I want to limit the whole search results as it is mentioned in this thread, not only the number of results per page. ;-)
Quote Reply
Re: [P-Man] Limit displayed results... In reply to
This is not possible directly, if you want to use paging feature.
So in this case you need to simulate the limited search results. There is no other way, to limit the results.
You can create a plugin which manipulates the paging feature when more than X limit results are available, and doesn't allow more than X limit links to be displayed.


If you are not interested in using the paging feature, the it is possible to use the LIMIT SQL feature, but this will result to display all search results on the same page.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...