A
Arsalan Ahmad
Hi,
May be I am a newbie, or may be i dont have that much insight in following
systems ..i.e. why i have some confusions as below:
In many websites, when search is performed on some keywords (not only
including google which perform general search but other sites which perform
seach on a particular type of item in their database) then many search
results are obtained (for example more than 100 or even more than 1000) but
only limited amount of results are displayed in a page (like for example 10
results per page). Thus in order to display the next 10 results, a user has
to click on 'Next' button. Similarly, it is possible that a user can click
on 'Previous' button to display the previous 10 results. My question is what
are different mechanisms to perform this and which one would be most optimal
than others?
Why I am asking this question because, if we are performing a search by
sending a query of keywords to a website then we get following procedure:
Browser->Send Query->ASP.NET page(considering we are using ASP.NET although
it could be PHP or ASP or JSP etc)
Now internally from ASP.NET page, a database connection is opened (say using
ADO.NET) and search is performed by sending a query to database and getting
the results. So we get:
ASP.NET page->Send query to database (using ADO.NET)
Now database returns recordset containing more than lets say 100 records (or
1000 records)
Database->Send back 1000 records->ASP.NET page
And then ASP.NET page send 10 records to client and drop the rest. So:
ASP.NET page->Send 10 records->Client Browser.
So now when the client press Next button what happens? It seems illogical to
send same search query to database and then dropping first 10 records from
recordset and only passing recordset from 11th record to 20th records to
client browser.
So, can anyone please tell me what are different approaches to handle this.
Thanks,
Arsalan
May be I am a newbie, or may be i dont have that much insight in following
systems ..i.e. why i have some confusions as below:
In many websites, when search is performed on some keywords (not only
including google which perform general search but other sites which perform
seach on a particular type of item in their database) then many search
results are obtained (for example more than 100 or even more than 1000) but
only limited amount of results are displayed in a page (like for example 10
results per page). Thus in order to display the next 10 results, a user has
to click on 'Next' button. Similarly, it is possible that a user can click
on 'Previous' button to display the previous 10 results. My question is what
are different mechanisms to perform this and which one would be most optimal
than others?
Why I am asking this question because, if we are performing a search by
sending a query of keywords to a website then we get following procedure:
Browser->Send Query->ASP.NET page(considering we are using ASP.NET although
it could be PHP or ASP or JSP etc)
Now internally from ASP.NET page, a database connection is opened (say using
ADO.NET) and search is performed by sending a query to database and getting
the results. So we get:
ASP.NET page->Send query to database (using ADO.NET)
Now database returns recordset containing more than lets say 100 records (or
1000 records)
Database->Send back 1000 records->ASP.NET page
And then ASP.NET page send 10 records to client and drop the rest. So:
ASP.NET page->Send 10 records->Client Browser.
So now when the client press Next button what happens? It seems illogical to
send same search query to database and then dropping first 10 records from
recordset and only passing recordset from 11th record to 20th records to
client browser.
So, can anyone please tell me what are different approaches to handle this.
Thanks,
Arsalan