S
S
sevic2020-02-11 21:35:46
PHP
sevic, 2020-02-11 21:35:46

How to implement a search on the site, where to store the search results?

For example, there is a table with articles number of articles 100k+. The search is based on keywords plus or without checkboxes. On the page with the results, 10 or 20 links to articles will be displayed, if there are more results, then you will have to flip through accordingly. How to implement a search in a table? to pull out all the results at once, or to request as many as are displayed on the page using LIMIT? If you pull out all the results, then where to store them?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
demon51085, 2020-02-11
@demon51085

Why pull out everything if not everything will be shown? Naturally with the help of LIMIT.

A
Antonio Solo, 2020-02-12
@solotony

how to implement? I like the sphinx. he will do everything himself. just feed it data.

X
xmoonlight, 2020-02-12
@xmoonlight

You need 3 tables:
1. Data table (your data is a list)
2. Index table (unique words, parameters, etc.)
3. Many-to-many relationship table for the first two tables.
Additionally:
1. limit, of course, do not forget to specify at the end.
2. (If you need to display!) To determine the total number of records that match the query criteria, you can simply get count without any information.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question