Paging: Saving Search Results

What is the correct way to work with a webpage that returns search results that may have different results from one moment to another?

those. When returning a query, the first time may contain different results when the user clicks on page 2 and starts the query again.

How do most people deal with this scenario? As a rule, I work with internal ASP.Net applications (where security / bandwidth is not a huge problem), so I will store the results in ViewState, and on the reverse side, data that is opposite to database queries.

What is the proper methodology for using an external WWW? My best guess is to store the results in a temporary database table (not literally in the temp table, I think the “stage” could be more accurate), but I think the table will be heavily clogged with / etc inserts / deletes. and I think you will need a table cleanup process that doesn't seem like a very elegant solution.

Am I anywhere near?

+3
source share
3 answers

... , , - . , (, Twitter), , , :

?q=your+query&olderthan={last result shown}&limit=10

... {last result shown} - . ID: SELECT * FROM table WHERE id < {last result shown}.

+2

, , .

+1

? , , ?

I did not asp in ages (before the .NET era :-)), but in PHP or rails you used sessions for any temporary storage. You can use the local file system (on the server) or the database as a session repository. There are optimization methods, so I won’t worry about the DB clogging up if you don’t have thousands of users. In addition, DBs are designed to handle thousands of inserts and exceptions - any main DB-SQL, MySQL, PostgreSQL server should not have any problems with it.

+1
source

Source: https://habr.com/ru/post/1722150/


All Articles