Gossamer Forum
Home : Products : DBMan : Customization :

Changing maxhits to maxpages

Quote Reply
Changing maxhits to maxpages
I am wanting to change something in the script. The problem I am having is that I want a search to return a limited amount of records, not per page but globally, for example, return a maximum of 50 records, 10 per page when 100 have been found that match the search. How can I achieve this?

Also, does anybody know if a text database can be exported into the sql version?

Finally, specially this question goes for Carol; remember the mod you helped me introduce to add a new account and a new record at the same time? Would like to know if that can be made with the sql version too. Lotsa thanks
Quote Reply
Re: Changing maxhits to maxpages In reply to
Thanks, Carol, I'll try that. Gosh, my database is getting too big and should get something new onto it.
Got any clues that could work? I know you are brilliant at working out solutions.

Do you think that using this maxhit solution will slower the search times?

Thanks JP
Quote Reply
Re: Changing maxhits to maxpages In reply to
Regarding limiting the total number of records returned, you might try this.

In db.cgi, sub query, after

$numhits++; # But we always count it!

add

Code:
if ($numhits == 50) {
last LINE;
}

It will only return the earliest records in your database, since it starts looking at the top and will stop when it hits 50.

I understand that the database can be imported into the SQL version, but I have no experience with it and don't know any details.

As for the mod, I have no idea. I can pretty much guarantee that any mod will work that doesn't directly access the files themselves. But I don't know SQL at all.


------------------
JPD





Quote Reply
Re: Changing maxhits to maxpages In reply to
I doubt that the maxhit solution will slow anything down. It just stops looking once you get 50 hits. It would probably speed things up.

I appreciate your confidence in my abilities, but I don't know SQL. I am really just scratching the surface with Perl. I also have no opportunity to work with SQL, since it's not available on my server. I have to "play" with something for quite a while before I can do anything with it.

This is something that Alex will have to address.


------------------
JPD