D
D
Daeamon2016-12-04 17:49:18
SQL
Daeamon, 2016-12-04 17:49:18

How to generate a list of the most matching elements by condition?

Hello. There are such tables (let's call them so)
7a9735f77d32425199c23b0aa7da6191.png
the number of records in the words table = 171
the number of records in the indexTable table = 2221
1. Take words (at the beginning we take 1 first word)
2. Find all elements from the news table containing this word (words)
3. We find all the words that are contained in these news
4. We return to the first point with these words and so on until separate groups of ratios of word groups and news groups are organized and as a result we need to select those word groups in which there is the most news, let's say the first 10 such groups.
While I'm going through the asp.net script, it's a bit combined with selections from the database, but it works rather slowly.
Is there any way to write a query to the database to get such a list.)))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MrDywar Pichugin, 2016-12-04
@Dywar

On Habré mail, in my opinion, they wrote an article on how their search works, as I understand it, you are trying to make a selection of the most suitable news for the user's request, this is the same thing that mail, yandex, google does. To study their experience, where they wrote something.
Write a request to Google
site:habrahabr.ru mail search algorithm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question